From 2cc69110d7e5b2cd13fdd29f6b49e48ff4404e7d Mon Sep 17 00:00:00 2001 From: Jeongjin Oh Date: Wed, 4 Oct 2023 06:21:19 +0900 Subject: [PATCH] feat(tags-input): add test for editing tag with mouse double click (#921) test(tags-input): add test for editing tag with mouse double click --- e2e/tags-input.e2e.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/e2e/tags-input.e2e.ts b/e2e/tags-input.e2e.ts index 40e2930ad1..8f99adce96 100644 --- a/e2e/tags-input.e2e.ts +++ b/e2e/tags-input.e2e.ts @@ -142,6 +142,30 @@ test.describe("tags-input", () => { await expect(page.locator(input)).toBeFocused() }) + test("edit tag with mouse double click", async ({ page }) => { + const svelte = item("Svelte") + await page.type(input, svelte.text) + await page.keyboard.press("Enter") + + const solid = item("Solid") + await page.type(input, solid.text) + await page.keyboard.press("Enter") + + await page.locator(svelte.tag).dblclick() + + await expect(page.locator(svelte.input)).toBeFocused() + await expect(page.locator(svelte.input)).toHaveValue("Svelte") + + const jenkins = item("Jenkins") + await page.keyboard.type(jenkins.text) + await page.keyboard.press("Enter") + + await expectToBeHighlighted(page.locator(jenkins.tag)) + await expect(page.locator(jenkins.input)).toBeHidden() + + await expect(page.locator(input)).toBeFocused() + }) + test("add tags from paste event", async ({ page }) => { await page.check(testid("addOnPaste")) await page.focus(input)