0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-27 21:39:16 -05:00

refactor(test): fix integration test assertion

This commit is contained in:
Gao Sun 2023-11-06 10:36:46 +08:00
parent 1f8a3a47e0
commit 8dff98b1e0
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
2 changed files with 4 additions and 3 deletions

View file

@ -13,6 +13,7 @@ import {
generateResourceIndicator, generateResourceIndicator,
generateScopeName, generateScopeName,
generateRoleName, generateRoleName,
dcls,
} from '#src/utils.js'; } from '#src/utils.js';
import { import {
@ -209,7 +210,7 @@ describe('M2M RBAC', () => {
it('assign a permission to a role on the role details page', async () => { it('assign a permission to a role on the role details page', async () => {
// Wait for the deletion confirmation modal to disappear. // Wait for the deletion confirmation modal to disappear.
await page.waitForSelector('.ReactModalPortal div[class$=header] div[class$=titleEllipsis]', { await page.waitForSelector(['.ReactModalPortal', dcls('header'), dcls('title')].join(' '), {
hidden: true, hidden: true,
}); });

View file

@ -9,7 +9,7 @@ import {
logtoConsoleUrl as logtoConsoleUrlString, logtoConsoleUrl as logtoConsoleUrlString,
} from '#src/constants.js'; } from '#src/constants.js';
import { clearConnectorsByTypes, setEmailConnector } from '#src/helpers/connector.js'; import { clearConnectorsByTypes, setEmailConnector } from '#src/helpers/connector.js';
import { expectNavigation, waitFor } from '#src/utils.js'; import { dcls, expectNavigation, waitFor } from '#src/utils.js';
export const goToAdminConsole = async () => { export const goToAdminConsole = async () => {
const logtoConsoleUrl = new URL(logtoConsoleUrlString); const logtoConsoleUrl = new URL(logtoConsoleUrlString);
@ -90,7 +90,7 @@ export const expectToClickDetailsPageOption = async (page: Page, optionText: str
export const expectModalWithTitle = async (page: Page, title: string | RegExp) => { export const expectModalWithTitle = async (page: Page, title: string | RegExp) => {
await expect(page).toMatchElement( await expect(page).toMatchElement(
'.ReactModalPortal div[class$=header] div[class$=titleEllipsis]', ['.ReactModalPortal', dcls('header'), dcls('title')].join(' '),
{ {
text: title, text: title,
} }