Skip to content

Commit

Permalink
remove spy
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtimid committed Sep 26, 2024
1 parent 12e8474 commit ac57bf8
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions packages/snaps-utils/src/iframe.test.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ describe('createWindow', () => {
if (iframe) {
document.body.removeChild(iframe);
}

jest.resetAllMocks();
});

it('creates an iframe window with the provided job ID as the iframe ID', async () => {
Expand Down Expand Up @@ -60,18 +58,4 @@ describe('createWindow', () => {
expect(iframe).toBeDefined();
expect(iframe.getAttribute('data-testid')).toBe('snaps-iframe');
});

it('rejects the promise if contentWindow is not present', async () => {
jest.spyOn(document, 'createElement').mockImplementation(() => {
const iframe = document.createElement('iframe');
Object.defineProperty(iframe, 'contentWindow', { value: null });
return iframe;
});

await expect(
createWindow({ uri: IFRAME_URL, id: MOCK_JOB_ID }),
).rejects.toThrow(
`iframe.contentWindow not present on load for job "${MOCK_JOB_ID}".`,
);
});
});

0 comments on commit ac57bf8

Please sign in to comment.