Adds test for sorting file names

This commit is contained in:
Aaron Louie 2020-02-11 11:06:58 -05:00
parent 3c4ac7f4d8
commit 760d52a559

View File

@ -103,6 +103,18 @@ describe('FileListComponent', () => {
expect(component).toBeTruthy();
});
it('should sort files by name', () => {
let prevFileMeta;
for (const thisFileMeta of component.fileMetas) {
if (!prevFileMeta) {
prevFileMeta = thisFileMeta;
} else {
expect(thisFileMeta.name).toBeGreaterThan(prevFileMeta.name);
prevFileMeta = thisFileMeta;
}
}
});
it('should show a confirmation dialog before deleting a file', () => {
const mockConfirmDeleteData: DeleteFileDialogData = {