Skip to content

Commit

Permalink
Update functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
sebelga committed Apr 20, 2023
1 parent 7a79d7f commit f145adb
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/plugins/files/server/integration_tests/file_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ describe('FileService', () => {
createDisposableFile({ fileKind, name: 'foo-2' }),
createDisposableFile({ fileKind, name: 'foo-3' }),
createDisposableFile({ fileKind, name: 'test-3' }),
createDisposableFile({ fileKind: fileKindNonDefault, name: 'foo-1' }),
]);
{
const { files, total } = await fileService.find({
Expand All @@ -166,7 +167,7 @@ describe('FileService', () => {
page: 1,
});
expect(files.length).toBe(2);
expect(total).toBe(3);
expect(total).toBe(4);
}

{
Expand All @@ -176,7 +177,19 @@ describe('FileService', () => {
perPage: 2,
page: 2,
});
expect(files.length).toBe(1);
expect(files.length).toBe(2);
expect(total).toBe(4);
}

// Filter out fileKind
{
const { files, total } = await fileService.find({
kindToExclude: [fileKindNonDefault],
name: ['foo*'],
perPage: 10,
page: 1,
});
expect(files.length).toBe(3); // foo-1 from fileKindNonDefault not returned
expect(total).toBe(3);
}
});
Expand Down

0 comments on commit f145adb

Please sign in to comment.