Skip to content

Commit 32681c4

Browse files
committed
Update test for azure integration test
1 parent 60c093e commit 32681c4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/oidc-test-provider.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,13 @@ async function waitForTitle(
282282
): Promise<void> {
283283
await browser.waitUntil(async () => {
284284
const actual = (await browser.$(selector).getText()).trim();
285-
let matches;
286-
if (typeof expected === 'string')
285+
let matches: boolean;
286+
if (typeof expected === 'string') {
287287
matches = actual.toLowerCase() === expected.toLowerCase();
288-
else matches = expected.test(actual);
288+
} else {
289+
matches = expected.test(actual);
290+
}
291+
289292
if (!matches) {
290293
throw new Error(`Wanted title "${String(expected)}", saw "${actual}"`);
291294
}
@@ -481,7 +484,7 @@ export async function azureBrowserDeviceAuthFlow({
481484
try {
482485
const normalizeUserCode = (str: string) => str.replace(/-/g, '');
483486
browser = await spawnBrowser(verificationUrl, true);
484-
await waitForTitle(browser, 'Enter code', 'div[role="heading"]');
487+
await waitForTitle(browser, /Enter code/, 'div[role="heading"]');
485488
await ensureValue(
486489
browser,
487490
'input[name="otc"]',

0 commit comments

Comments
 (0)