Skip to content

Commit

Permalink
RTL testing for db import
Browse files Browse the repository at this point in the history
  • Loading branch information
lyndsiWilliams committed Apr 7, 2022
1 parent b61afd4 commit b4c6b6a
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,24 @@ describe('DatabaseModal', () => {
*/
});
});

describe('Import database flow', () => {
it('imports a file', () => {
const importDbButton = screen.getByTestId('import-database-btn');
expect(importDbButton).toBeVisible();

const testFile = new File([new ArrayBuffer(1)], 'model_export.zip');

userEvent.click(importDbButton);
userEvent.upload(importDbButton, testFile);

expect(importDbButton.files[0]).toStrictEqual(testFile);
expect(importDbButton.files.item(0)).toStrictEqual(testFile);
expect(importDbButton.files).toHaveLength(1);
});
});
});

describe('DatabaseModal w/ Deeplinking Engine', () => {
const renderAndWait = async () => {
const mounted = act(async () => {
Expand Down

0 comments on commit b4c6b6a

Please sign in to comment.