style: step 2-3 - uniform text tokens in login+main page, fix tsconfig build exclusions
This commit is contained in:
@@ -72,7 +72,7 @@ export async function clickAndWait(
|
||||
*/
|
||||
export async function getText(page: Page, selector: string): Promise<string> {
|
||||
const locator = page.locator(selector);
|
||||
return locator.textContent() || '';
|
||||
return (await locator.textContent()) ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -285,7 +285,7 @@ export async function getLocalStorage(page: Page, key: string): Promise<string |
|
||||
* Set localStorage data
|
||||
*/
|
||||
export async function setLocalStorage(page: Page, key: string, value: string): Promise<void> {
|
||||
await page.evaluate((k, v) => localStorage.setItem(k, v), key, value);
|
||||
await page.evaluate(({ k, v }: { k: string; v: string }) => localStorage.setItem(k, v), { k: key, v: value });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -331,7 +331,7 @@ export async function mockApiResponse(
|
||||
route.continue();
|
||||
});
|
||||
|
||||
await page.on('route', (route) => {
|
||||
page.on('route', (route) => {
|
||||
if (route.request().url().match(urlPattern)) {
|
||||
route.respond({
|
||||
status,
|
||||
|
||||
Reference in New Issue
Block a user