diff --git a/packages/apps/esm-primary-navigation-app/src/root.component.test.tsx b/packages/apps/esm-primary-navigation-app/src/root.component.test.tsx index 6fa44e637..f1163317f 100644 --- a/packages/apps/esm-primary-navigation-app/src/root.component.test.tsx +++ b/packages/apps/esm-primary-navigation-app/src/root.component.test.tsx @@ -2,14 +2,15 @@ import React from 'react'; import { of } from 'rxjs'; import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import { useConfig, useConnectedExtensions, useSession } from '@openmrs/esm-framework'; import { isDesktop } from './utils'; import { mockUser } from '../__mocks__/mock-user'; import { mockSession } from '../__mocks__/mock-session'; import Root from './root.component'; -import { useConfig, useConnectedExtensions, useSession } from '@openmrs/esm-framework'; const mockUserObservable = of(mockUser); const mockSessionObservable = of({ data: mockSession }); +const mockIsDesktop = jest.mocked(isDesktop); const mockedUseConfig = useConfig as jest.Mock; const mockedUseConnectedExtensions = useConnectedExtensions as jest.Mock; @@ -55,7 +56,7 @@ describe('Root', () => { describe('when view is desktop', () => { beforeEach(() => { - (isDesktop as jest.Mock).mockImplementation(() => true); + mockIsDesktop.mockImplementation(() => true); }); it('does not render side menu button if desktop', async () => { diff --git a/packages/framework/esm-styleguide/mock.tsx b/packages/framework/esm-styleguide/mock.tsx index 7ae441f9b..de97d64ba 100644 --- a/packages/framework/esm-styleguide/mock.tsx +++ b/packages/framework/esm-styleguide/mock.tsx @@ -72,6 +72,8 @@ export const LaboratoryPictogram = () =>
LaboratoryPictogramPictogram
export const PatientListsPictogram = () =>
PatientListsPictogram
; export const ServiceQueuesPictogram = () =>
ServiceQueuesPictogramPictogram
; +export { PageHeader, PageHeaderContent } from './src/page-header/page-header.component'; + export const LocationPicker = jest.fn(({ onChange, selectedLocationUuid }) => { const locations = [ { diff --git a/packages/framework/esm-styleguide/src/page-header/page-header.component.tsx b/packages/framework/esm-styleguide/src/page-header/page-header.component.tsx index c26bb8920..96a12604c 100644 --- a/packages/framework/esm-styleguide/src/page-header/page-header.component.tsx +++ b/packages/framework/esm-styleguide/src/page-header/page-header.component.tsx @@ -1,9 +1,9 @@ /** @module @category UI */ import React from 'react'; +import classNames from 'classnames'; import { useConfig } from '@openmrs/esm-react-utils'; import { type StyleguideConfigObject } from '../config-schema'; import styles from './page-header.module.scss'; -import classNames from 'classnames'; export interface PageHeaderContentProps { title: string | JSX.Element;