Skip to content

Commit

Permalink
added test for new #hasFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Oct 20, 2022
1 parent 794edc5 commit bc14648
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,14 @@ describe('UploadState', () => {
expectObservable(uploadState.clear$, '^').toBe(' ---0-', [undefined]);
});
});

it('correctly detects when files are ready for upload', () => {
const file1 = { name: 'test' } as File;
const file2 = { name: 'test 2.png' } as File;
expect(uploadState.hasFiles()).toBe(false);
uploadState.setFiles([file1, file2]);
expect(uploadState.hasFiles()).toBe(true);
uploadState.setFiles([]);
expect(uploadState.hasFiles()).toBe(false);
});
});

0 comments on commit bc14648

Please sign in to comment.