diff --git a/tests/custom-key-bindings.spec.js b/tests/custom-key-bindings.spec.js index 612bff8..0d48c6e 100644 --- a/tests/custom-key-bindings.spec.js +++ b/tests/custom-key-bindings.spec.js @@ -29,3 +29,30 @@ test("add custom key binding", async ({page}) => { await page.locator("body").press("Control+Shift+H") await expect(page.locator("css=.language-selector .items > li.selected")).toBeVisible() }) + +test("delete custom key binding", async ({page}) => { + await page.locator("css=.status-block.settings").click() + await page.locator("css=.overlay .settings .dialog .sidebar li.tab-keyboard-bindings").click() + await expect(page.locator("css=.settings .tab-content.tab-keyboard-bindings")).toBeVisible() + await page.locator("css=.settings .tab-content.tab-keyboard-bindings .add-keybinding").click() + await expect(page.locator("css=.settings .tab-content.tab-keyboard-bindings .add-key-binding-dialog")).toBeVisible() + await expect(page.locator("css=.settings .tab-content.tab-keyboard-bindings .add-key-binding-dialog input.keys")).toBeFocused() + await page.locator("body").press("Control+Shift+H") + await page.locator("body").press("Enter") + await page.locator("body").pressSequentially("language") + await page.locator(".p-autocomplete-list li.p-autocomplete-option.p-focus").click() + await page.locator("css=.settings .tab-content.tab-keyboard-bindings .add-key-binding-dialog .save").click() + await expect(page.locator("css=.settings .tab-content.tab-keyboard-bindings table tr.keybind-user")).toHaveCount(1) + await page.locator("css=.overlay .settings .dialog .bottom-bar .close").click() + await page.locator("body").press("Control+Shift+H") + await expect(page.locator("css=.language-selector .items > li.selected")).toBeVisible() + + await page.locator("css=.status-block.settings").click() + await page.locator("css=.overlay .settings .dialog .sidebar li.tab-keyboard-bindings").click() + await expect(page.locator("css=.settings .tab-content.tab-keyboard-bindings")).toBeVisible() + await page.locator("css=.settings .tab-content.tab-keyboard-bindings table tr.keybind-user .delete").click() + await expect(page.locator("css=.settings .tab-content.tab-keyboard-bindings table tr.keybind-user")).toHaveCount(0) + await page.locator("css=.overlay .settings .dialog .bottom-bar .close").click() + await page.locator("body").press("Control+Shift+H") + await expect(page.locator("css=.language-selector .items > li.selected")).toHaveCount(0) +})