Skip to content

Commit

Permalink
refactor(tests): use new locators to find elements
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonGolms committed Nov 9, 2022
1 parent 5929188 commit 5432bcf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/Message/MessageAccessInformation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test.describe('MessageAccessInformation', () => {
);
const [newPage] = await Promise.all([
context.waitForEvent('page'),
component.locator('a', { hasText: 'Microsoft Docs' }).click(), // Opens a new tab
component.getByRole('link', { name: 'Microsoft Docs' }).click(), // Opens a new tab
]);
await newPage.waitForLoadState();
await expect(await newPage.title()).toBeTruthy();
Expand All @@ -38,7 +38,7 @@ test.describe('MessageAccessInformation', () => {
);
const [newPage] = await Promise.all([
context.waitForEvent('page'),
component.locator('a', { hasText: 'How to add app roles in Azure AD apps' }).click(), // Opens a new tab
component.getByRole('link', { name: 'How to add app roles in Azure AD apps' }).click(), // Opens a new tab
]);
await newPage.waitForLoadState();
await expect(await newPage.title()).toBeTruthy();
Expand Down
6 changes: 3 additions & 3 deletions src/components/Message/MessagePermissionsInformation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test.describe('MessagePermissionsInformation', () => {
);
const [newPage] = await Promise.all([
context.waitForEvent('page'),
component.locator('a', { hasText: 'Microsoft Docs' }).click(), // Opens a new tab
component.getByRole('link', { name: 'Microsoft Docs' }).click(), // Opens a new tab
]);
await newPage.waitForLoadState();
await expect(await newPage.title()).toBeTruthy();
Expand All @@ -38,7 +38,7 @@ test.describe('MessagePermissionsInformation', () => {
);
const [newPage] = await Promise.all([
context.waitForEvent('page'),
component.locator('a', { hasText: 'Microsoft Graph' }).click(), // Opens a new tab
component.getByRole('link', { name: 'Microsoft Graph' }).click(), // Opens a new tab
]);
await newPage.waitForLoadState();
await expect(await newPage.title()).toBeTruthy();
Expand All @@ -52,7 +52,7 @@ test.describe('MessagePermissionsInformation', () => {
);
const [newPage] = await Promise.all([
context.waitForEvent('page'),
component.locator('a', { hasText: 'Permissions and consent in the Microsoft identity platform' }).click(), // Opens a new tab
component.getByRole('link', { name: 'Permissions and consent in the Microsoft identity platform' }).click(), // Opens a new tab
]);
await newPage.waitForLoadState();
await expect(await newPage.title()).toBeTruthy();
Expand Down

0 comments on commit 5432bcf

Please sign in to comment.