Skip to content

Commit

Permalink
test: fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardo committed Mar 27, 2023
1 parent 1ab4fd2 commit 276618e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/modules/__tests__/current.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import {
DIMENSION_ID_ORGUNIT,
} from '@dhis2/analytics'
import { DEFAULT_CURRENT } from '../../reducers/current.js'
import { getAxesFromUi, getSingleValueCurrentFromUi } from '../current.js'
import {
getAxesFromUi,
getSingleValueCurrentFromUi,
getOptionsFromUi,
} from '../current.js'
import { getOptionsForUi } from '../options.js'

const dxItem1id = 'dxItem1id'
const dxItem2id = 'dxItem2id'
Expand Down Expand Up @@ -37,7 +42,7 @@ const ui = {
[DIMENSION_ID_PERIOD]: peItems,
[DIMENSION_ID_ORGUNIT]: ouItems,
},
options: {},
options: getOptionsForUi(),
}

describe('getAxesFromUi', () => {
Expand Down Expand Up @@ -66,6 +71,7 @@ describe('getAxesFromUi', () => {
describe('getSingleValueCurrentFromUi', () => {
it('should return only the 1st item in dx', () => {
const expectedState = {
...getOptionsFromUi(ui),
columns: [
{ dimension: DIMENSION_ID_DATA, items: [{ id: dxItem1id }] },
],
Expand All @@ -75,12 +81,6 @@ describe('getSingleValueCurrentFromUi', () => {
{ dimension: DIMENSION_ID_PERIOD, items: [{ id: peItemId }] },
],
rows: [],
reportingParams: {
organisationUnit: undefined,
reportingPeriod: undefined,
parentOrganisationUnit: undefined,
grandParentOrganisationUnit: undefined,
},
type: 'SINGLEVALUE',
}

Expand Down

0 comments on commit 276618e

Please sign in to comment.