Last active
June 10, 2024 23:36
-
-
Save reboottime/7d9fdb9d0be5be578b8ec4f0396306f4 to your computer and use it in GitHub Desktop.
Test Select picture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test.describe('Upload Organization Logo', () => { | |
let fileChooserPromise: Promise<FileChooser>; | |
test.beforeEach(async ({ page }) => { | |
fileChooserPromise = page.waitForEvent('filechooser'); | |
await page | |
.getByRole('button', { name: 'Select Company Logo' }) | |
.click(); | |
}); | |
test('Shows user error message if user selected file with size more than 5MB', async ({ | |
page, | |
}) => { | |
const fileChooser = await fileChooserPromise; | |
await fileChooser.setFiles('e2e/mock/assets/logo.large.png'); | |
await expect(page.getByTestId('toast')).toContainText( | |
'Error Picture size should not be larger than 5MB' | |
); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment