test(e2e): add tests for the progress reset flow (#54614)

This commit is contained in:
Huyen Nguyen
2024-05-13 14:29:39 +07:00
committed by GitHub
parent f3dafb36a4
commit 6c3e1cefc1
4 changed files with 129 additions and 51 deletions
+7 -37
View File
@@ -418,51 +418,21 @@ test.describe('Settings', () => {
}
});
test('Should validate Danger Section Settings', async ({ page }) => {
test('Should display the Danger section properly', async ({ page }) => {
await expect(page.getByText('Danger Zone')).toBeVisible();
await expect(
page.getByText(translations.settings.danger.heading, {
exact: true
})
page.getByText(
'Please be careful. Changes in this section are permanent.'
)
).toBeVisible();
await expect(
page.getByText(translations.settings.danger['be-careful'], {
exact: true
})
).toBeVisible();
await page
.getByRole('button', {
name: translations.settings.danger.reset,
exact: true
})
.click();
await page
.getByRole('button', {
name: translations.settings.danger['nevermind-2'],
exact: true
})
.click();
await expect(
page.getByRole('button', {
name: translations.settings.danger['reset-confirm'],
exact: true
name: 'Reset all of my progress'
})
).toBeVisible();
await page
.getByRole('button', {
name: translations.settings.danger.delete,
exact: true
})
.click();
await page
.getByRole('button', {
name: translations.settings.danger.nevermind,
exact: true
})
.click();
await expect(
page.getByRole('button', {
name: translations.settings.danger.certain,
exact: true
name: 'Delete my account'
})
).toBeVisible();
});