mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 14:03:24 +09:00
refactor: replace jquery.are-you-sure with first-party code (#39233)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -24,3 +24,15 @@ test('comment on and close an issue', async ({page, request}) => {
|
||||
await page.getByRole('button', {name: 'Close Issue'}).click();
|
||||
await expect(page.getByRole('button', {name: 'Reopen Issue'})).toBeVisible();
|
||||
});
|
||||
|
||||
test('unsaved issue description prompts before leaving', async ({page, request}) => {
|
||||
const repoName = `e2e-are-you-sure-${randomString(8)}`;
|
||||
await Promise.all([apiCreateRepo(request, {name: repoName, autoInit: false}), login(page)]);
|
||||
await page.goto(`/${env.GITEA_TEST_E2E_USER}/${repoName}/issues/new`);
|
||||
await page.getByPlaceholder('Leave a comment').press('a');
|
||||
const dialogPromise = page.waitForEvent('dialog');
|
||||
page.once('dialog', (dialog) => dialog.dismiss());
|
||||
await page.getByRole('link', {name: 'Dashboard'}).click();
|
||||
expect((await dialogPromise).type()).toBe('beforeunload');
|
||||
await expect(page).toHaveURL(/\/issues\/new$/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user