Skip to content

Commit

Permalink
fix: test cleanup and remove unused css file
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen committed Sep 26, 2024
1 parent 23ac30a commit db371f8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const defaultProps = {
test('renders menu for active type MAP and type CHART', async () => {
useDhis2ConnectionStatus.mockImplementation(jest.fn(() => online))
const props = Object.assign({}, defaultProps, {
type: CHART,
activeType: MAP,
type: CHART,
visualization: {
type: 'COLUMN',
},
Expand All @@ -51,8 +51,8 @@ test('renders menu for active type MAP and type CHART', async () => {
test('renders menu for active type CHART and type MAP', async () => {
useDhis2ConnectionStatus.mockImplementation(jest.fn(() => online))
const props = Object.assign({}, defaultProps, {
type: MAP,
activeType: CHART,
type: MAP,
visualization: {
mapViews: [{ layer: 'thematic' }],
},
Expand Down Expand Up @@ -87,8 +87,8 @@ test('renders disabled menu items when offline', () => {
test('renders menu for active type MAP and type MAP without Thematic layer', async () => {
useDhis2ConnectionStatus.mockImplementation(jest.fn(() => online))
const props = Object.assign({}, defaultProps, {
type: MAP,
activeType: MAP,
type: MAP,
visualization: {
mapViews: [{ layer: 'earthEngine' }],
},
Expand All @@ -110,8 +110,8 @@ test('renders menu for active type MAP and type MAP without Thematic layer', asy
test('renders menu for active type MAP and type MAP without Thematic layer when offline', async () => {
useDhis2ConnectionStatus.mockImplementation(jest.fn(() => offline))
const props = Object.assign({}, defaultProps, {
type: MAP,
activeType: MAP,
type: MAP,
visualization: {
mapViews: [{ layer: 'earthEngine' }],
},
Expand All @@ -133,8 +133,8 @@ test('renders menu for active type MAP and type MAP without Thematic layer when
test('renders menu for active type REPORT_TABLE and type CHART', async () => {
useDhis2ConnectionStatus.mockImplementation(jest.fn(() => online))
const props = Object.assign({}, defaultProps, {
type: CHART,
activeType: REPORT_TABLE,
type: CHART,
visualization: { type: 'COLUMN' },
})

Expand All @@ -148,8 +148,8 @@ test('renders menu for active type REPORT_TABLE and type CHART', async () => {
test('renders menu for active type CHART and type REPORT_TABLE', async () => {
useDhis2ConnectionStatus.mockImplementation(jest.fn(() => online))
const props = Object.assign({}, defaultProps, {
type: REPORT_TABLE,
activeType: CHART,
type: REPORT_TABLE,
visualization: { type: 'PIVOT_TABLE' },
})

Expand All @@ -163,8 +163,8 @@ test('renders menu for active type CHART and type REPORT_TABLE', async () => {
test('renders menu for active type EVENT_REPORT and type EVENT_CHART', async () => {
useDhis2ConnectionStatus.mockImplementation(jest.fn(() => online))
const props = Object.assign({}, defaultProps, {
type: EVENT_CHART,
activeType: EVENT_REPORT,
type: EVENT_CHART,
visualization: {},
})

Expand All @@ -178,8 +178,8 @@ test('renders menu for active type EVENT_REPORT and type EVENT_CHART', async ()
test('renders menu for active type EVENT_CHART and type EVENT_REPORT', async () => {
useDhis2ConnectionStatus.mockImplementation(jest.fn(() => online))
const props = Object.assign({}, defaultProps, {
type: EVENT_REPORT,
activeType: EVENT_CHART,
type: EVENT_REPORT,
visualization: {},
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const DEFAULT_STORE_WITH_ONE_ITEM = {
},
}

test('renders a MapPlugin when activeType is MAP', () => {
test('renders a VisualizationPlugin when activeType is MAP', () => {
const { container } = render(
<Provider store={mockStore(DEFAULT_STORE_WITH_ONE_ITEM)}>
<Visualization
Expand Down Expand Up @@ -92,24 +92,6 @@ test('renders a VisualizationPlugin for REPORT_TABLE', () => {
expect(container).toMatchSnapshot()
})

test('renders active type MAP rather than original type REPORT_TABLE', () => {
const { container } = render(
<Provider store={mockStore(DEFAULT_STORE_WITH_ONE_ITEM)}>
<Visualization
item={{
id: 'rainbow',
type: 'VISUALIZATION',
visualization: { id: 'rainbowVis', type: 'PIVOT_TABLE' },
}}
activeType="MAP"
itemFilters={{}}
availableHeight={500}
/>
</Provider>
)
expect(container).toMatchSnapshot()
})

test('renders a DefaultPlugin when activeType is EVENT_CHART', () => {
const { container } = render(
<Provider store={mockStore(DEFAULT_STORE_WITH_ONE_ITEM)}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,37 +93,6 @@ exports[`renders a DefaultPlugin when activeType is EVENT_REPORT 1`] = `
</div>
`;

exports[`renders a MapPlugin when activeType is MAP 1`] = `
<div>
<div
style="height: 500px;"
>
<div
class="jsx-3042342945 "
data-test="dhis2-uicore-componentcover"
>
<div
class="messageContent"
>
<svg
color="#a0adba"
height="24"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12.847 2.794l.056.102 8.416 17.674a1 1 0 01-.786 1.423l-.117.007H3.584a1 1 0 01-.947-1.322l.044-.108 8.416-17.674a1 1 0 011.75-.102zM12 5.65L5.167 19.999h13.665zM12 17a1 1 0 110 2 1 1 0 010-2zm1-7v6h-2v-6z"
fill="currentColor"
/>
</svg>
No data to display
</div>
</div>
</div>
</div>
`;

exports[`renders a VisualizationPlugin for CHART 1`] = `
<div>
<div
Expand Down Expand Up @@ -186,7 +155,7 @@ exports[`renders a VisualizationPlugin for REPORT_TABLE 1`] = `
</div>
`;

exports[`renders active type MAP rather than original type REPORT_TABLE 1`] = `
exports[`renders a VisualizationPlugin when activeType is MAP 1`] = `
<div>
<div
style="height: 500px;"
Expand Down

This file was deleted.

0 comments on commit db371f8

Please sign in to comment.