Skip to content

Commit

Permalink
Fix cookie with expires test
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamWr committed Sep 11, 2024
1 parent eb39027 commit 83ca0fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/scriptlets/trusted-set-cookie.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ test('Set cookie with expires', (assert) => {
const done = assert.async();

setTimeout(() => {
// It looks like Chrome is caching document.cookie and value is not updated,
// so as a workaround we remove dummy cookie to force update of document.cookie
clearCookie('dummyCookie');
assert.strictEqual(document.cookie.includes(cName), false, 'Cookie name has been deleted');
assert.strictEqual(document.cookie.includes(cValue), false, 'Cookie value has been deleted');
clearCookie(cName);
Expand Down

0 comments on commit 83ca0fa

Please sign in to comment.