import { whatsOn } from '../../__mocks__/whats-on' ; import { mountWithTheme } from '@weco/common/test/fixtures/enzyme-helpers' ; import WhatsOnPage from '../../pages/whats-on' ; jest . mock ( '@weco/common/server-data' ) ; const featuredExhibitionSelector = '[data-test-id="featured-exhibition"]' ; const noExhibitionsSelector = '[data-test-id="no-exhibitions"]' ; describe ( '/whats-on' , ( ) => { it ( 'renders a featured exhibition when there is one' , ( ) => { const pageWithExhibition = mountWithTheme ( < WhatsOnPage { ... whatsOn ( true ) } / > ) ; expect ( pageWithExhibition . exists ( featuredExhibitionSelector ) ) . toBe ( true ) ; expect ( pageWithExhibition . exists ( noExhibitionsSelector ) ) . toBe ( false ) ; } ) ; it ( 'renders no exhibitions when there are none' , ( ) => { const pageWithoutExhibition = mountWithTheme ( < WhatsOnPage { ... whatsOn ( false ) } / > ) ; expect ( pageWithoutExhibition . exists ( featuredExhibitionSelector ) ) . toBe ( false ) ; expect ( pageWithoutExhibition . exists ( noExhibitionsSelector ) ) . toBe ( true ) ; } ) ; } ) ;