Skip to content

Commit

Permalink
Remove unnecessary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
atjn committed Dec 14, 2023
1 parent 3f5c798 commit 358a590
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 47 deletions.
4 changes: 2 additions & 2 deletions src/lib/components/modal/Modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let dialog: HTMLDialogElement | undefined;
/**
* Will allows the user to close the modal by clicking outside it.
* Allows the user to close the modal by clicking outside it.
*/
export let closeOnBackdrop: boolean = false;
Expand All @@ -22,7 +22,7 @@
/**
* Closes the modal if the user clicks outside it
* Only works if ModalCloseOnBackdrop is true
* Only works if closeOnBackdrop is true
*/
function closeOnBackdropClick(event: MouseEvent) {
if (!closeOnBackdrop) return;
Expand Down
45 changes: 0 additions & 45 deletions tests/lib/components/settings/settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,48 +81,3 @@ test("change to color tab", async ({ page }) => {
await expect(buttons[0]).toHaveClass(/active/);
await expect(buttons[1]).not.toHaveClass(/active/);
});

test("returns to svg-view when closing through top navbar", async ({
page,
}) => {
await expect(page.locator(".canvas svg")).not.toBeVisible();

// Click the setting button in the nav-bar again
await page
.getByRole("button", { name: "settings Settings", exact: true })
.click();

await expect(page.locator(".canvas svg")).toBeVisible();
});

test("returns to svg-view when closing through button", async ({ page }) => {
await expect(page.locator(".canvas svg")).not.toBeVisible();

// Click the close button in setting view
await page
.getByRole("button", { name: "Close Settings", exact: true })
.click();

await expect(page.locator(".canvas svg")).toBeVisible();
});

test("can reopen settings after closing", async ({ page }) => {
await expect(page.locator(".canvas svg")).not.toBeVisible();

// Click the close button in setting view
await page
.getByRole("button", { name: "Close Settings", exact: true })
.click();

await expect(page.locator(".canvas svg")).toBeVisible();

// Click the open settings button to reopen
await page.getByRole("button", { name: "Options", exact: true }).hover();
await page
.getByRole("button", { name: "settings Settings", exact: true })
.click();

// Check if the tab buttons are visible
const buttons = await getTabButtons(page);
expect(buttons).toHaveLength(2);
});

0 comments on commit 358a590

Please sign in to comment.