Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

Commit

Permalink
properly normalize state data in api.spec.js getLinkableFields test (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjiO authored and jspaine committed Oct 13, 2017
1 parent 3ed194b commit 400f27d
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions client/modules/questionnaire/reducers/api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,23 @@ describe('questionnaire api reducer', function() {
const state = {
entities: {
questionnaires: {
1: {_id: 1, identifier: 1, sections: [
{_id: 1, fields: [{_id: 1, type: fieldTypes.TEXT}]}
]},
2: {_id: 2, identifier: 2, sections: [
{_id: 2, fields: [
{_id: 1, type: fieldTypes.TEXT},
{_id: 2, type: widgetTypes.HOUSEHOLD},
{_id: 3, type: fieldTypes.DATE}
]}
]},
1: {_id: 1, identifier: 1, sections: [1]},
2: {_id: 2, identifier: 2, sections: [2]},
3: {_id: 3, identifier: 3}
},
sections: {
1: {_id: 1, fields: [1]},
2: {_id: 2, fields: [1, 2, 3]},
},
fields: {
1: {_id: 1, type: fieldTypes.TEXT},
2: {_id: 2, type: widgetTypes.HOUSEHOLD},
3: {_id: 3, type: fieldTypes.DATE},
}
},
questionnaires: {ids: [1, 2, 3]}
questionnaires: {ids: [1, 2, 3]},
sections: {ids: [1, 2]},
fields: {ids: [1, 2, 3]}
}

const questionnaires = selectors.getLinkableFields(state)(1)
Expand Down

0 comments on commit 400f27d

Please sign in to comment.