Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(vue): Get exact selector when testing Organization Profile custom pages and links #5400

Merged
merged 1 commit into from
Mar 19, 2025
Merged
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
15 changes: 9 additions & 6 deletions integration/tests/vue/components.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,19 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withCustomRoles] })('basic te
await u.page.waitForSelector('.cl-organizationSwitcherPopoverCard', { state: 'visible' });
await u.page.locator('.cl-button__manageOrganization').click();

// Check if custom pages and links are visible
await expect(u.page.getByRole('button', { name: /Terms/i })).toBeVisible();
await expect(u.page.getByRole('button', { name: /Homepage/i })).toBeVisible();
// Get the organization profile dialog
const dialog = u.page.getByRole('dialog');

// Check if custom pages and links are visible within the dialog
await expect(dialog.getByRole('button', { name: /Terms/i })).toBeVisible();
await expect(dialog.getByRole('button', { name: /Homepage/i })).toBeVisible();

// Navigate to custom page
await u.page.getByRole('button', { name: /Terms/i }).click();
await expect(u.page.getByRole('heading', { name: 'Custom Terms Page' })).toBeVisible();
await dialog.getByRole('button', { name: /Terms/i }).click();
await expect(dialog.getByRole('heading', { name: 'Custom Terms Page' })).toBeVisible();

// Click custom link and check navigation
await u.page.getByRole('button', { name: /Homepage/i }).click();
await dialog.getByRole('button', { name: /Homepage/i }).click();
await u.page.waitForAppUrl('/');
});

Expand Down