mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This commit updates scripts within `packages/common` to relative imports as a prep work to the upcoming infra updates. PR Close #60623
33 lines
1 KiB
TypeScript
33 lines
1 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.dev/license
|
|
*/
|
|
|
|
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.dev/license
|
|
*/
|
|
|
|
import {parseCookieValue} from '../src/cookie';
|
|
|
|
describe('cookies', () => {
|
|
it('parses cookies', () => {
|
|
const cookie = 'other-cookie=false; xsrf-token=token-value; is_awesome=true; ffo=true;';
|
|
expect(parseCookieValue(cookie, 'xsrf-token')).toBe('token-value');
|
|
});
|
|
it('handles encoded keys', () => {
|
|
expect(parseCookieValue('whitespace%20token=token-value', 'whitespace token')).toBe(
|
|
'token-value',
|
|
);
|
|
});
|
|
it('handles encoded values', () => {
|
|
expect(parseCookieValue('token=whitespace%20', 'token')).toBe('whitespace ');
|
|
expect(parseCookieValue('token=whitespace%0A', 'token')).toBe('whitespace\n');
|
|
});
|
|
});
|