chore: import upstream snapshot with attribution
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import {
|
||||
deleteAllEmails,
|
||||
getAllEmails,
|
||||
getFirstEmail,
|
||||
getSubject
|
||||
} from './utils/email';
|
||||
|
||||
test.beforeEach(async () => {
|
||||
await deleteAllEmails();
|
||||
});
|
||||
|
||||
test('should be possible to report a user from their profile page', async ({
|
||||
page
|
||||
}) => {
|
||||
await page.goto('/twaha');
|
||||
|
||||
await page.getByText("Flag This User's Account for Abuse").click();
|
||||
|
||||
await expect(
|
||||
page.getByText("Do you want to report twaha's portfolio for abuse?")
|
||||
).toBeVisible();
|
||||
|
||||
await page
|
||||
.getByRole('textbox', { name: 'What would you like to report?' })
|
||||
.fill('Some details');
|
||||
await page.getByRole('button', { name: 'Submit the report' }).click();
|
||||
await expect(page).toHaveURL('/learn');
|
||||
|
||||
await expect(page.getByTestId('flash-message')).toBeVisible();
|
||||
await expect(page.getByTestId('flash-message')).toContainText(
|
||||
'A report was sent to the team with foo@bar.com in copy'
|
||||
);
|
||||
|
||||
await expect(async () => {
|
||||
const emails = await getAllEmails();
|
||||
expect(emails.messages).toHaveLength(1);
|
||||
expect(getSubject(getFirstEmail(emails))).toBe(
|
||||
"Abuse Report : Reporting twaha's profile."
|
||||
);
|
||||
}).toPass();
|
||||
});
|
||||
Reference in New Issue
Block a user