Skip to content

Commit

Permalink
tests: remove unload test
Browse files Browse the repository at this point in the history
  • Loading branch information
wqcstrong committed Dec 6, 2023
1 parent 6baf819 commit 17a6efd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tests/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,14 @@ describe('new PageSpy([config])', () => {
expect(window.navigator.sendBeacon).not.toBe(originBeacon);
});

it('Content load and unload', async () => {
it('Content load', async () => {
const init = jest.spyOn(SDK.prototype, 'init');
const close = jest.spyOn(socketStore, 'close');

new SDK();

window.dispatchEvent(new Event('DOMContentLoaded'));
expect(init).toHaveBeenCalled();

window.dispatchEvent(new Event('beforeunload'));
expect(close).toHaveBeenCalled();
});
it('Init connection', async () => {
const sdk = new SDK();
Expand Down

0 comments on commit 17a6efd

Please sign in to comment.