Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better wording
Browse files Browse the repository at this point in the history
and added a testid to close modal button
WhyAsh5114 committed Dec 22, 2023
1 parent 6d644d6 commit 8ffa0ed
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/lib/components/MyModal.svelte
Original file line number Diff line number Diff line change
@@ -20,7 +20,9 @@
on:close={onClose}
>
<form class="modal-box bg-primary text-white" method="dialog">
<button class="btn btn-sm btn-circle absolute right-2 top-2">✕</button>
<button class="btn btn-sm btn-circle absolute right-2 top-2" data-testid="close-modal-button">
</button>
<h2 class="font-bold text-lg {titleColor} mb-5">{title}</h2>
<slot />
</form>
2 changes: 1 addition & 1 deletion src/routes/mesocycles/[mode]/extras/+page.svelte
Original file line number Diff line number Diff line change
@@ -228,6 +228,6 @@
{:else if !data.mesocycleTemplate}
Create mesocycle
{:else if data.mesocycleTemplate}
Edit mesocycle
Update mesocycle
{/if}
</button>
2 changes: 1 addition & 1 deletion tests/mesocycles/create.spec.ts
Original file line number Diff line number Diff line change
@@ -116,7 +116,7 @@ test("should successfully create a mesocycle", async ({ page }) => {
// Create the mesocycle
await page.getByRole("button", { name: "Create mesocycle" }).click();
await expect(page.locator("#Success")).toContainText("✕ Success Mesocycle created successfully");
await page.locator("#Success").getByRole("button", { name: "✕" }).click();
await page.locator("#Success").getByTestId("close-modal-button").click();
});

test("should show the created mesocycle", async ({ page }) => {

0 comments on commit 8ffa0ed

Please sign in to comment.