Skip to content

Commit 566d8c7

Browse files
committed
test(nav): add sampling tests for folders with files (#369)
1 parent 0446725 commit 566d8c7

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

xfs/nav/traverse-sample_test.go

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,10 @@ var _ = Describe("Traverse With Sample", Ordered, func() {
125125
prohibited: []string{"cover.night-drive.jpg"},
126126
},
127127
noOf: nav.SampleNoOf{
128-
Files: 2,
129-
Folders: 2,
128+
Files: 2,
130129
},
131130
expectedNoOf: directoryQuantities{
132-
files: 6,
131+
files: 8,
133132
},
134133
}),
135134

@@ -194,6 +193,34 @@ var _ = Describe("Traverse With Sample", Ordered, func() {
194193
},
195194
}),
196195

196+
Entry(nil, &sampleTE{
197+
naviTE: naviTE{
198+
message: "folders: default (first), with 2 folders",
199+
should: "invoke for at most 2 folders per directory",
200+
subscription: nav.SubscribeFoldersWithFiles,
201+
prohibited: []string{"Electric Youth"},
202+
},
203+
noOf: nav.SampleNoOf{
204+
Folders: 2,
205+
},
206+
expectedNoOf: directoryQuantities{
207+
folders: 6,
208+
},
209+
}),
210+
211+
Entry(nil, &sampleTE{
212+
naviTE: naviTE{
213+
message: "folders: custom, with last single folder",
214+
should: "invoke for only last folder per directory",
215+
subscription: nav.SubscribeFoldersWithFiles,
216+
prohibited: []string{"Chromatics"},
217+
},
218+
useLastFn: true,
219+
noOf: nav.SampleNoOf{
220+
Folders: 1,
221+
},
222+
}),
223+
197224
// TODO: With filter for folders: first Co* folder (College)
198225

199226
Entry(nil, &sampleTE{

0 commit comments

Comments
 (0)