MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / TestRefreshIgnoresEmptyDirectories

Function TestRefreshIgnoresEmptyDirectories

internal/tui/picker_test.go:851–870  ·  view source on GitHub ↗

--- Empty Directory Filtering Tests ---

(t *testing.T)

Source from the content-addressed store, hash-verified

849// --- Empty Directory Filtering Tests ---
850
851func TestRefreshIgnoresEmptyDirectories(t *testing.T) {
852 tmpDir := t.TempDir()
853 prdsDir := filepath.Join(tmpDir, ".chief", "prds")
854
855 // Create an empty directory (simulates cancelled chief new)
856 emptyDir := filepath.Join(prdsDir, "cancelled")
857 if err := os.MkdirAll(emptyDir, 0755); err != nil {
858 t.Fatalf("Failed to create empty dir: %v", err)
859 }
860
861 p := &PRDPicker{
862 basePath: tmpDir,
863 entries: make([]PRDEntry, 0),
864 }
865 p.Refresh()
866
867 if len(p.entries) != 0 {
868 t.Errorf("expected 0 entries for empty directory, got %d", len(p.entries))
869 }
870}
871
872func TestRefreshShowsDirectoryWithPrdMdOnly(t *testing.T) {
873 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 1

RefreshMethod · 0.95

Tested by

no test coverage detected