Skip to content

Commit

Permalink
fix: manual updates for react/vite migration
Browse files Browse the repository at this point in the history
  • Loading branch information
kabaros committed Oct 24, 2024
1 parent 3297817 commit 96a18ce
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 36 deletions.
6 changes: 3 additions & 3 deletions src/__tests__/AppWrapper.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ jest.mock('@dhis2/app-runtime-adapter-d2', () => {
})

jest.mock(
'../components/App',
'../components/App.jsx',
() =>
function MockApp() {
return <div />
}
)

jest.mock(
'../components/SystemSettingsProvider.js',
'../components/SystemSettingsProvider.jsx',
() =>
function Mock() {
return <div className="SystemSettingsProvider" />
}
)
jest.mock(
'../components/UserSettingsProvider.js',
'../components/UserSettingsProvider.jsx',
() =>
function Mock() {
return <div className="UserSettingsProvider" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ exports[`Filter renders with empty filter text 1`] = `
type="text"
value=""
/>
</div>
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Item/AppItem/__tests__/Item.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jest.mock('@dhis2/ui', () => {
})

jest.mock(
'../../ItemHeader/DeleteItemButton.js',
'../../ItemHeader/DeleteItemButton.jsx',
() =>
function Mock() {
return <div className="DeleteItemButton" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useSystemSettings } from '../../../../SystemSettingsProvider.jsx'
import WindowDimensionsProvider from '../../../../WindowDimensionsProvider.jsx'
import ItemContextMenu from '../ItemContextMenu.jsx'

jest.mock('../../../../SystemSettingsProvider', () => {
jest.mock('../../../../SystemSettingsProvider.jsx', () => {
return {
__esModule: true,
default: jest.fn((children) => <div>{children}</div>),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useSystemSettings } from '../../../../SystemSettingsProvider.jsx'
import WindowDimensionsProvider from '../../../../WindowDimensionsProvider.jsx'
import ItemContextMenu from '../ItemContextMenu.jsx'

jest.mock('../../../../SystemSettingsProvider', () => {
jest.mock('../../../../SystemSettingsProvider.jsx', () => {
return {
__esModule: true,
default: jest.fn((children) => <div>{children}</div>),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jest.mock('@dhis2/analytics', () => ({
}))

jest.mock(
'../LegacyPlugin',
'../LegacyPlugin.jsx',
() =>
function MockLegacyPlugin() {
return <div className="legacy-plugin" />
}
)

jest.mock(
'../IframePlugin',
'../IframePlugin.jsx',
() =>
function MockIframePlugin() {
return <div className="iframe-plugin" />
Expand Down
4 changes: 2 additions & 2 deletions src/components/Item/VisualizationItem/__tests__/Item.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import WindowDimensionsProvider from '../../../WindowDimensionsProvider.jsx'
import Item from '../Item.jsx'

jest.mock('../../../../api/fetchVisualization')
jest.mock('../../../SystemSettingsProvider')
jest.mock('../../../SystemSettingsProvider.jsx')
jest.mock('../Visualization/plugin', () => {
return {
pluginIsAvailable: () => true,
}
})

jest.mock(
'../../ItemHeader/DeleteItemButton.js',
'../../ItemHeader/DeleteItemButton.jsx',
() =>
function Mock() {
return <div className="DeleteItemButton" />
Expand Down
6 changes: 3 additions & 3 deletions src/components/__tests__/App.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jest.mock('../../api/dataStatistics.js', () => {
})

jest.mock(
'../DashboardsBar/DashboardsBar',
'../DashboardsBar/DashboardsBar.jsx',
() =>
function MockDashboardsBar() {
return <div>DashboardsBar</div>
Expand All @@ -68,7 +68,7 @@ jest.mock('../../pages/view', () => {
}
})

jest.mock('../SystemSettingsProvider', () => {
jest.mock('../SystemSettingsProvider.jsx', () => {
return {
__esModule: true,
default: jest.fn((children) => <div>{children}</div>),
Expand All @@ -78,7 +78,7 @@ jest.mock('../SystemSettingsProvider', () => {
}
})

jest.mock('../UserSettingsProvider', () => {
jest.mock('../UserSettingsProvider.jsx', () => {
return {
__esModule: true,
default: jest.fn((children) => <div>{children}</div>),
Expand Down
4 changes: 2 additions & 2 deletions src/pages/edit/__tests__/ActionsBar.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jest.mock('@dhis2/analytics', () => {
/* eslint-enable react/prop-types */

jest.mock(
'../FilterSettingsDialog',
'../FilterSettingsDialog.jsx',
() =>
function Mock() {
return <div className="mock-filter-settings-dialog" />
Expand All @@ -56,7 +56,7 @@ jest.mock(

/* eslint-disable react/prop-types */
jest.mock(
'../../../components/ConfirmActionDialog',
'../../../components/ConfirmActionDialog.jsx',
() =>
function MockConfirmActionDialog({ open }) {
return open ? <div className="mock-confirm-action-dialog" /> : null
Expand Down
10 changes: 5 additions & 5 deletions src/pages/edit/__tests__/EditDashboard.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,38 @@ jest.mock('@dhis2/ui', () => {
/* eslint-enable react/prop-types */

jest.mock(
'../../../components/Notice.js',
'../../../components/Notice.jsx',
() =>
function Mock() {
return <div className="Notice" />
}
)

jest.mock(
'../ActionsBar',
'../ActionsBar.jsx',
() =>
function MockActionsBar() {
return <div>ActionsBar</div>
}
)

jest.mock(
'../TitleBar',
'../TitleBar.jsx',
() =>
function MockTitleBar() {
return <div>TitleBar</div>
}
)
jest.mock(
'../ItemGrid',
'../ItemGrid.jsx',
() =>
function MockEditItemGrid() {
return <div>ItemGrid</div>
}
)

jest.mock(
'../../print/PrintLayoutDashboard',
'../../print/PrintLayoutDashboard.jsx',
() =>
function MockLayoutPrintPreview() {
return <div>LayoutPrintPreview</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/edit/__tests__/FilterSettingsDialog.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jest.mock('@dhis2/ui', () => {
})
/* eslint-enable react/prop-types, react/no-unknown-property */

jest.mock('../../../modules/useDimensions', () => ({
jest.mock('../../../modules/useDimensions.js', () => ({
__esModule: true,
default: () => {
return [
Expand Down
8 changes: 4 additions & 4 deletions src/pages/edit/__tests__/NewDashboard.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@ jest.mock('@dhis2/ui', () => {
/* eslint-enable react/prop-types */

jest.mock(
'../ActionsBar',
'../ActionsBar.jsx',
() =>
function MockActionsBar() {
return <div>ActionsBar</div>
}
)

jest.mock(
'../TitleBar',
'../TitleBar.jsx',
() =>
function MockTitleBar() {
return <div>TitleBar</div>
}
)
jest.mock(
'../ItemGrid',
'../ItemGrid.jsx',
() =>
function MockEditItemGrid() {
return <div>ItemGrid</div>
}
)

jest.mock(
'../../print/PrintLayoutDashboard',
'../../print/PrintLayoutDashboard.jsx',
() =>
function MockLayoutPrintPreview() {
return <div>LayoutPrintPreview</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/edit/__tests__/TitleBar.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import TitleBar from '../TitleBar.jsx'
const mockStore = configureMockStore()

jest.mock(
'../ItemSelector/ItemSelector.js',
'../ItemSelector/ItemSelector.jsx',
() =>
function MockItemSelector() {
return <div className="item-selector" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ exports[`renders Save and Discard buttons but not translation dialog when new da
Filter settings
</div>
</div>
</div>
<div
class="ui-Button"
Expand All @@ -52,8 +50,6 @@ exports[`renders Save and Discard buttons but not translation dialog when new da
<div
class="mock-filter-settings-dialog"
/>
</div>
`;

Expand Down
2 changes: 1 addition & 1 deletion src/pages/view/TitleBar/__tests__/FilterSelector.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jest.mock('@dhis2/app-runtime', () => ({

/* eslint-disable react/prop-types */
jest.mock(
'../../../../components/DropdownButton/DropdownButton.js',
'../../../../components/DropdownButton/DropdownButton.jsx',
() =>
function Mock({ children, ...props }) {
return (
Expand Down
8 changes: 4 additions & 4 deletions src/pages/view/__tests__/ViewDashboard.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,31 @@ jest.mock('@dhis2/app-runtime', () => ({
jest.mock('../../../api/fetchDashboard')

jest.mock(
'../../../components/DashboardsBar/DashboardsBar',
'../../../components/DashboardsBar/DashboardsBar.jsx',
() =>
function MockDashboardsBar() {
return <div>DashboardsBar</div>
}
)

jest.mock(
'../TitleBar/TitleBar',
'../TitleBar/TitleBar.jsx',
() =>
function MockTitleBar() {
return <div>TitleBar</div>
}
)

jest.mock(
'../FilterBar/FilterBar',
'../FilterBar/FilterBar.jsx',
() =>
function MockFilterBar() {
return <div>MockFilterBar</div>
}
)

jest.mock(
'../ItemGrid',
'../ItemGrid.jsx',
() =>
function MockItemGrid() {
return <div>MockItemGrid</div>
Expand Down

0 comments on commit 96a18ce

Please sign in to comment.