Skip to content

Instantly share code, notes, and snippets.

@reboottime
Last active June 10, 2024 23:36
Show Gist options
  • Save reboottime/7d9fdb9d0be5be578b8ec4f0396306f4 to your computer and use it in GitHub Desktop.
Save reboottime/7d9fdb9d0be5be578b8ec4f0396306f4 to your computer and use it in GitHub Desktop.
Test Select picture
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