Fix: get files by path depth (#2993)
* fix: get files up to depth specified by colletion path * test(e2e): update mock data * chore: fix comment
This commit is contained in:
@ -484,6 +484,34 @@ describe('gitlab backend', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('filterFile', () => {
|
||||
it('should return true for nested file with matching depth', () => {
|
||||
backend = resolveBackend(defaultConfig);
|
||||
|
||||
expect(
|
||||
backend.implementation.filterFile(
|
||||
'content/posts',
|
||||
{ name: 'index.md', path: 'content/posts/dir1/dir2/index.md' },
|
||||
'md',
|
||||
3,
|
||||
),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for nested file with non matching depth', () => {
|
||||
backend = resolveBackend(defaultConfig);
|
||||
|
||||
expect(
|
||||
backend.implementation.filterFile(
|
||||
'content/posts',
|
||||
{ name: 'index.md', path: 'content/posts/dir1/dir2/index.md' },
|
||||
'md',
|
||||
2,
|
||||
),
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
nock.cleanAll();
|
||||
authStore.logout();
|
||||
|
Reference in New Issue
Block a user