Skip to content

Commit

Permalink
fixed unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mirafedas committed Sep 13, 2024
1 parent f3223b4 commit 9c1e5c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libs/blocks/merch/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default async function handleUpgradeOffer(
window.location.hash = hash;
window.addEventListener('milo:modal:closed', () => {
window.location.hash = prevHash;
});
}, { once: true });
}
return getModal(null, { id: 'switch-modal', content, closeEvent: 'closeModal', class: ['upgrade-flow-modal'] });
};
Expand Down
2 changes: 1 addition & 1 deletion test/blocks/merch/upgrade.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('Switch Modal (Upgrade Flow)', () => {
window.location.hash = '#prev-hash';
await handler(new Event('click'), 'new-hash');
expect(window.location.hash).to.equal('#new-hash');
window.dispatchEvent(new Event('milo:modal:closed'));
document.querySelector('.dialog-modal.upgrade-flow-modal').dispatchEvent(new Event('closeModal'));
expect(window.location.hash).to.equal('#prev-hash');
window.location.hash = initialHash;
});
Expand Down

0 comments on commit 9c1e5c4

Please sign in to comment.