Skip to content

Commit

Permalink
test: add test for 'should parse cookie with large Max-Age correctly' (
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Apr 10, 2024
1 parent 01d4293 commit bff9f30
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/library/browsercontext-cookies.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,3 +400,30 @@ it('should support requestStorageAccess', async ({ page, server, channel, browse
}
}
});

it('should parse cookie with large Max-Age correctly', async ({ server, page, defaultSameSiteCookieValue, browserName, platform }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/30305' });
it.fixme(browserName === 'webkit' && platform === 'linux', 'https://github.com/microsoft/playwright/issues/30305');

server.setRoute('/foobar', (req, res) => {
res.setHeader('set-cookie', [
'cookie1=value1; Path=/; Expires=Thu, 08 Sep 2270 15:06:12 GMT; Max-Age=7776000000'
]);
res.statusCode = 200;
res.end();
});
await page.goto(server.PREFIX + '/foobar');
expect(await page.evaluate(() => document.cookie)).toBe('cookie1=value1');
expect(await page.context().cookies()).toEqual([
{
name: 'cookie1',
value: 'value1',
domain: 'localhost',
path: '/',
expires: expect.any(Number),
httpOnly: false,
secure: false,
sameSite: defaultSameSiteCookieValue,
},
]);
});

0 comments on commit bff9f30

Please sign in to comment.