Skip to content

Commit

Permalink
feat(add-consent): fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
UralKrc committed Apr 10, 2024
1 parent 29c7d45 commit 2db9bf2
Showing 1 changed file with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
import { getZaraz } from '../helpers/get-zaraz';
import { setAllCheckboxes } from './set-all-checkboxes';

jest.mock('../helpers/get-zaraz');
declare global {
interface Window {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
zaraz: any;
}
}

let windowObj: Window & typeof globalThis;

beforeAll(() => {
windowObj = window;
});

afterAll(() => {
window = windowObj;
});

describe('setAllCheckboxes()', () => {
it('should call setAllCheckboxes method on zaraz consent with the correct argument', () => {
const setAllCheckboxesMock = jest.fn();
(getZaraz as jest.Mock).mockReturnValue({
window.zaraz = {
consent: {
setAllCheckboxes: setAllCheckboxesMock,
},
});
};

setAllCheckboxes(true);

Expand Down

0 comments on commit 2db9bf2

Please sign in to comment.