import { getBillboard } from '../packs/billboard'; describe('getBillboard', () => { beforeEach(() => { global.Honeybadger = { notify: jest.fn() }; document.body.innerHTML = `
`; }); test('should make a call to the correct placement url', async () => { const fetchPromise = Promise.resolve('fetch response'); window.fetch = jest.fn(fetchPromise); await getBillboard(); expect(window.fetch).toHaveBeenCalledWith('/billboards/sidebar_left'); expect(window.fetch).toHaveBeenCalledWith('/billboards/sidebar_left_2'); }); });