diff --git a/.gitattributes b/.gitattributes index 9cb80309760..f1795e4fd1e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,6 +6,5 @@ /templates/swagger/*.generated.json linguist-generated /options/fileicon/** linguist-generated /vendor/** -text -eol linguist-vendored -/web_src/js/vendor/** -text -eol linguist-vendored Dockerfile.* linguist-language=Dockerfile Makefile.* linguist-language=Makefile diff --git a/eslint.config.ts b/eslint.config.ts index 2f545612202..53bcfc46f53 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -32,7 +32,6 @@ const restrictedProperties = [ export default defineConfig([ globalIgnores([ - 'web_src/js/vendor', 'web_src/fomantic', 'public/assets/js', ]), diff --git a/tests/e2e/issue-comment.test.ts b/tests/e2e/issue-comment.test.ts index 414e0567ce2..b78d40b49a4 100644 --- a/tests/e2e/issue-comment.test.ts +++ b/tests/e2e/issue-comment.test.ts @@ -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$/); +}); diff --git a/web_src/js/components/ViewFileTreeItem.vue b/web_src/js/components/ViewFileTreeItem.vue index 235925253cb..4fa9de79780 100644 --- a/web_src/js/components/ViewFileTreeItem.vue +++ b/web_src/js/components/ViewFileTreeItem.vue @@ -1,7 +1,7 @@