Skip to content

Commit f97261d

Browse files
committed
chore: update tests
1 parent d15745a commit f97261d

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

site/e2e/tests/deployment/idpOrgSync.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ test.describe("IdpOrgSyncPage", () => {
7878
).toBeVisible();
7979
});
8080

81-
test("toggle default organization assignment", async ({ page }) => {
81+
test("toggle off default organization assignment", async ({ page }) => {
8282
requiresLicense();
8383
await page.goto("/deployment/idp-org-sync", {
8484
waitUntil: "domcontentloaded",
@@ -89,6 +89,12 @@ test.describe("IdpOrgSyncPage", () => {
8989
});
9090
await toggle.click();
9191

92+
const dialog = page.getByRole("dialog");
93+
await expect(dialog).toBeVisible();
94+
95+
await dialog.getByRole("button", { name: "Confirm" }).click();
96+
await expect(dialog).not.toBeVisible();
97+
9298
await expect(
9399
page.getByText("Organization sync settings updated."),
94100
).toBeVisible();

site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.stories.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Meta, StoryObj } from "@storybook/react";
2+
import { userEvent, within } from "@storybook/test";
23
import {
34
MockOrganization,
45
MockOrganization2,
@@ -48,3 +49,18 @@ export const MissingGroups: Story = {
4849
organizationSyncSettings: MockOrganizationSyncSettings,
4950
},
5051
};
52+
53+
export const AssignDefaultOrgWarningDialog: Story = {
54+
args: {
55+
organizationSyncSettings: MockOrganizationSyncSettings,
56+
organizations: [MockOrganization, MockOrganization2],
57+
},
58+
play: async ({ canvasElement }) => {
59+
const canvas = within(canvasElement);
60+
await userEvent.click(
61+
canvas.getByRole("switch", {
62+
name: "Assign Default Organization",
63+
}),
64+
);
65+
},
66+
};

0 commit comments

Comments
 (0)