Skip to content

Commit

Permalink
Merge branch 'fix_replaced_mode_regression' into hack_to_disable_unus…
Browse files Browse the repository at this point in the history
…ed_app_check_for_android_fermata
  • Loading branch information
shankari committed May 5, 2024
2 parents 00a4d95 + 20b9e1a commit 1efda2e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions www/__tests__/confirmHelper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ const fakeDefaultLabelOptions = {
},
},
};
const fakeInputs = {
MODE: [
{ data: { label: 'walk', start_ts: 1245, end_ts: 5678 } },
{ data: { label: 'bike', start_ts: 1245, end_ts: 5678 } },
],
PURPOSE: [
{ data: { label: 'home', start_ts: 1245, end_ts: 5678 } },
{ data: { label: 'work', start_ts: 1245, end_ts: 5678 } },
],
};

jest.mock('../js/services/commHelper', () => ({
...jest.requireActual('../js/services/commHelper'),
Expand All @@ -62,8 +72,8 @@ describe('confirmHelper', () => {

it('returns base labelInputDetails for a labelUserInput which does not have mode of study', () => {
const fakeLabelUserInput = {
MODE: fakeDefaultLabelOptions.MODE[1],
PURPOSE: fakeDefaultLabelOptions.PURPOSE[0],
MODE: fakeInputs.MODE[1],
PURPOSE: fakeInputs.PURPOSE[0],
};
const labelInputDetails = labelInputDetailsForTrip(
fakeLabelUserInput,
Expand All @@ -74,8 +84,8 @@ describe('confirmHelper', () => {

it('returns full labelInputDetails for a labelUserInput which has the mode of study', () => {
const fakeLabelUserInput = {
MODE: fakeDefaultLabelOptions.MODE[0], // 'walk' is mode of study
PURPOSE: fakeDefaultLabelOptions.PURPOSE[0],
MODE: fakeInputs.MODE[0], // 'walk' is mode of study
PURPOSE: fakeInputs.PURPOSE[0],
};
const labelInputDetails = labelInputDetailsForTrip(
fakeLabelUserInput,
Expand Down

0 comments on commit 1efda2e

Please sign in to comment.