Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions tests/e2e/personas.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ test.describe("Personas view", () => {
.click();
const dialog = page.getByRole("dialog");
await expect(dialog).toBeVisible();
await expect(dialog).toHaveAttribute("aria-label", "Create persona");
await expect(
dialog.locator("h2", { hasText: "New Persona" }),
).toBeVisible();
// Check form fields
await expect(dialog.getByPlaceholder("e.g. Code Reviewer")).toBeVisible();
await expect(
Expand Down Expand Up @@ -109,7 +111,7 @@ test.describe("Personas view", () => {
.first()
.click();
await expect(page.getByRole("dialog")).toBeVisible();
await page.getByLabel("Close").click();
await page.getByRole("button", { name: "Close" }).click();
await expect(page.getByRole("dialog")).not.toBeVisible();
});

Expand All @@ -120,10 +122,9 @@ test.describe("Personas view", () => {
await page.getByLabel("Persona: Code Reviewer").click();
const dialog = page.getByRole("dialog");
await expect(dialog).toBeVisible();
await expect(dialog).toHaveAttribute(
"aria-label",
"Edit persona Code Reviewer",
);
await expect(
dialog.locator("h2", { hasText: "Edit Persona" }),
).toBeVisible();
// Fields should be pre-filled
await expect(dialog.getByPlaceholder("e.g. Code Reviewer")).toHaveValue(
"Code Reviewer",
Expand Down
5 changes: 2 additions & 3 deletions tests/e2e/skills.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test.describe("Skills view", () => {
await page.getByRole("button", { name: "New Skill" }).first().click();
const dialog = page.getByRole("dialog");
await expect(dialog).toBeVisible();
await expect(dialog).toHaveAttribute("aria-label", "New Skill");
await expect(dialog.locator("h2", { hasText: "New Skill" })).toBeVisible();
// Check form fields
await expect(dialog.getByPlaceholder("my-skill-name")).toBeVisible();
await expect(
Expand Down Expand Up @@ -115,7 +115,7 @@ test.describe("Skills view", () => {
await navigateToSkills(page);
await page.getByRole("button", { name: "New Skill" }).first().click();
await expect(page.getByRole("dialog")).toBeVisible();
await page.getByLabel("Close").click();
await page.getByRole("button", { name: "Close" }).click();
await expect(page.getByRole("dialog")).not.toBeVisible();
});

Expand Down Expand Up @@ -153,7 +153,6 @@ test.describe("Skills view", () => {
await page.getByRole("menuitem", { name: "Edit" }).click();
const dialog = page.getByRole("dialog");
await expect(dialog).toBeVisible();
await expect(dialog).toHaveAttribute("aria-label", "Edit Skill");
await expect(dialog.locator("h2", { hasText: "Edit Skill" })).toBeVisible();
// Name should be pre-filled and read-only
const nameInput = dialog.getByPlaceholder("my-skill-name");
Expand Down
Loading