Skip to content

Commit 7e50aae

Browse files
committed
test(vue): Get exact selector when testing organization profile custom pages and links
1 parent ea7ce70 commit 7e50aae

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

integration/tests/vue/components.test.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,16 +225,19 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withCustomRoles] })('basic te
225225
await u.page.waitForSelector('.cl-organizationSwitcherPopoverCard', { state: 'visible' });
226226
await u.page.locator('.cl-button__manageOrganization').click();
227227

228-
// Check if custom pages and links are visible
229-
await expect(u.page.getByRole('button', { name: /Terms/i })).toBeVisible();
230-
await expect(u.page.getByRole('button', { name: /Homepage/i })).toBeVisible();
228+
// Get the organization profile dialog
229+
const dialog = u.page.getByRole('dialog');
230+
231+
// Check if custom pages and links are visible within the dialog
232+
await expect(dialog.getByRole('button', { name: /Terms/i })).toBeVisible();
233+
await expect(dialog.getByRole('button', { name: /Homepage/i })).toBeVisible();
231234

232235
// Navigate to custom page
233-
await u.page.getByRole('button', { name: /Terms/i }).click();
234-
await expect(u.page.getByRole('heading', { name: 'Custom Terms Page' })).toBeVisible();
236+
await dialog.getByRole('button', { name: /Terms/i }).click();
237+
await expect(dialog.getByRole('heading', { name: 'Custom Terms Page' })).toBeVisible();
235238

236239
// Click custom link and check navigation
237-
await u.page.getByRole('button', { name: /Homepage/i }).click();
240+
await dialog.getByRole('button', { name: /Homepage/i }).click();
238241
await u.page.waitForAppUrl('/');
239242
});
240243

0 commit comments

Comments
 (0)