Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🏗️ Major Refactor to Remove Label Button Services #1086

Merged
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3b5e169
Merge branch 'master' of https://github.com/e-mission/e-mission-phone…
JGreenlee Oct 9, 2023
dc28f99
Merge branch 'input-matcher-rewrite' of https://github.com/jiji14/e-m…
JGreenlee Oct 25, 2023
8f76ecf
Merge branch 'input-matcher-rewrite' of https://github.com/jiji14/e-m…
JGreenlee Oct 25, 2023
8712380
use section summary for getDetectedModes
JGreenlee Oct 25, 2023
f7716cf
refactor filters: prep to remove buttons services
JGreenlee Oct 29, 2023
4d48aee
map user inputs instead of populating tlEntry objs
JGreenlee Oct 30, 2023
3855a03
remove btn services and survey.ts
JGreenlee Oct 30, 2023
40d3f75
add back verifiability with verifiabilityForTrip()
JGreenlee Oct 30, 2023
49ff385
remove populateCompositeTrips; update types
JGreenlee Oct 30, 2023
a34c219
TripCard: don't show footer if no notes
JGreenlee Oct 30, 2023
c262f6a
remove unused vars in LabelTab
JGreenlee Oct 30, 2023
9009517
fix label button showing before appConfig loaded
JGreenlee Oct 31, 2023
fb46586
combine processed+unprocessed survey responses
JGreenlee Oct 31, 2023
af5948b
move LabelTabContext to own file to expand types
JGreenlee Oct 31, 2023
d96ff8d
expand types
JGreenlee Oct 31, 2023
22b80f9
fix diaryHelper.test.ts
JGreenlee Oct 31, 2023
081b142
Merge branch 'input-matcher-rewrite' of https://github.com/jiji14/e-m…
JGreenlee Nov 1, 2023
956f2d9
Merge remote-tracking branch 'upstream/service_rewrite_2023' into rew…
JGreenlee Nov 2, 2023
5110845
apply prettier to PR #1086
JGreenlee Nov 2, 2023
1f952f7
remove 'locales' submodule
JGreenlee Nov 3, 2023
1b01692
fix syntax errors and apply prettier
JGreenlee Nov 3, 2023
5eb8d8f
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
JGreenlee Nov 3, 2023
24b34ee
clean up confirmHelper
JGreenlee Nov 3, 2023
55c313d
add tests for confirmHelper
JGreenlee Nov 3, 2023
a60b1e2
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
JGreenlee Nov 10, 2023
d3e6af2
fix en.json -> "questions"
JGreenlee Nov 10, 2023
69b18cb
remove duplicate 'verifiability' check
JGreenlee Nov 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix diaryHelper.test.ts
Since 8712380, the getDetectedModes function no longer goes through the sections of a trip and sums up distances to get percentages. We now use cleaned_section_summary and inferred_section_summary which are computed on the server for us. Updating the test to reflect this causes it to pass again.
  • Loading branch information
JGreenlee committed Oct 31, 2023
commit 22b80f97e508fe89857fac1d8b6f850c8161ba9d
35 changes: 25 additions & 10 deletions www/__tests__/diaryHelper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,30 @@ it('returns true/false is multi day', () => {
expect(isMultiDay("", "2023-09-18T00:00:00-09:00")).toBeFalsy();
});

//created a fake trip with relevant sections by examining log statements
let myFakeTrip = {sections: [
{ "sensed_mode_str": "BICYCLING", "distance": 6013.73657416706 },
{ "sensed_mode_str": "WALKING", "distance": 715.3078629361006 }
]};
let myFakeTrip2 = {sections: [
{ "sensed_mode_str": "BICYCLING", "distance": 6013.73657416706 },
{ "sensed_mode_str": "BICYCLING", "distance": 715.3078629361006 }
]};
/* fake trips with 'distance' in their section summaries
('count' and 'duration' are not used bygetDetectedModes) */
let myFakeTrip = {
distance: 6729.0444371031606,
cleaned_section_summary: {
// count: {...}
// duration: {...}
distance: {
BICYCLING: 6013.73657416706,
WALKING: 715.3078629361006,
},
},
} as any;

let myFakeTrip2 = {
...myFakeTrip,
inferred_section_summary: {
// count: {...}
// duration: {...}
distance: {
BICYCLING: 6729.0444371031606,
},
},
};

let myFakeDetectedModes = [
{ mode: "BICYCLING",
Expand All @@ -59,5 +74,5 @@ let myFakeDetectedModes2 = [
it('returns the detected modes, with percentages, for a trip', () => {
expect(getDetectedModes(myFakeTrip)).toEqual(myFakeDetectedModes);
expect(getDetectedModes(myFakeTrip2)).toEqual(myFakeDetectedModes2);
expect(getDetectedModes({})).toEqual([]); // empty trip, no sections, no modes
expect(getDetectedModes({} as any)).toEqual([]); // empty trip, no sections, no modes
})