import { render, act } from '@testing-library/react'; import { createMatchMediaMock, addMockToGlobal, removeMockFromGlobal, MatchMediaMock2, } from './helpers/MatchMediaMock2'; import { MatchMediaQuery } from '../MatchMediaQuery'; describe('MatchMediaQuery', () => { describe('MatchMediaQuery (functional mock API)', () => { let matchMediaMock: MatchMediaMock2; beforeEach(() => { matchMediaMock = createMatchMediaMock(); addMockToGlobal(matchMediaMock.matchMedia); }); afterEach(() => { matchMediaMock.cleanup(); }); afterAll(() => { removeMockFromGlobal(); }); it('does show inner div if query is satisfied', () => { matchMediaMock.mediaQuery = 'yes'; const result = render(