Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Use recursive type for cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
obulat committed Jan 31, 2023
1 parent 3f969e4 commit f6c28ce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/playwright/utils/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,13 @@ export const enableOldHeader = async (page: Page) => {
await setCookies(page.context(), { features: { new_header: "off" } })
}

export interface CookieMap {
[key: string]: string | boolean | string[] | CookieMap
}

export const setCookies = async (
context: BrowserContext,
cookies: Record<string, string | boolean | string[] | Record<string, string>>
cookies: CookieMap
) => {
await context.addCookies(
Object.entries(cookies).map(([name, value]) => ({
Expand Down

0 comments on commit f6c28ce

Please sign in to comment.