test: add test for 'should parse cookie with large Max-Age correctly' (#30323)

This commit is contained in:
Max Schmitt 2024-04-10 22:13:01 +02:00 committed by GitHub
parent 01d4293803
commit bff9f30b6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 27 additions and 0 deletions

View File

@ -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,
},
]);
});