test: should serialize storageState with lone surrogates (#29089)

https://github.com/microsoft/playwright-dotnet/issues/2819
This commit is contained in:
Max Schmitt 2024-01-29 19:22:33 +01:00 committed by GitHub
parent acc72c2663
commit cf70a01836
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -214,3 +214,11 @@ it('should handle malformed file', async ({ contextFactory }, testInfo) => {
else else
expect(error.message).toContain(`Error reading storage state from ${file}:\nUnexpected token o in JSON at position 1`); expect(error.message).toContain(`Error reading storage state from ${file}:\nUnexpected token o in JSON at position 1`);
}); });
it('should serialize storageState with lone surrogates', async ({ page, context, server }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright-dotnet/issues/2819' });
await page.goto(server.EMPTY_PAGE);
await page.evaluate(() => window.localStorage.setItem('foo', String.fromCharCode(55934)));
const storageState = await context.storageState();
expect(storageState.origins[0].localStorage[0].value).toBe(String.fromCharCode(55934));
});