-
Notifications
You must be signed in to change notification settings - Fork 114
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
🎀 UI Migration Wrap-up #1106
🎀 UI Migration Wrap-up #1106
Changes from all commits
6fc9894
6d64774
2c92ff9
0092ace
dd39c92
c0170de
30eccf3
c03324f
3760d25
2a0daf9
2871402
4df43c2
3242697
5b0cea0
ea60154
2c4afca
2d438f0
5bb56fe
80fa776
ebe7fe5
263c90a
99e1090
49a1a64
9f7bc4a
3d14e37
6b70afd
72b3f7a
12133ba
b60a05f
50fb40d
df0f03f
9e58c7e
3bebd8c
9a2567c
3e232ab
7a0ea59
cf7027e
45799c6
27549a3
2efb03d
fa1dfbf
44ecc45
31ce4d3
76e579e
f04079b
a0eb054
4959198
c0e29ef
f5dc166
76e6867
47acc03
ee2fe2a
aa9ee64
4f173ba
0f77f5c
b3dd4b1
60ef5ed
a9042d3
8e78f79
1a35e1f
107eb84
81f4558
0eab473
58fba92
17deb22
ae0ae28
80e3903
5cb8187
588f685
961ac78
68ae2bb
5166bef
27e7a51
1474833
01f33d3
f1bd447
cb7b191
d1927b3
0d417f2
e558163
0153f0f
ce81699
2c18cc1
e920752
385a384
6d5566e
40f7aad
4d9a8ef
98b08bf
78661da
c901e91
8178c1f
dd00645
a5edfb7
5f9c665
60f12b3
7286a04
aa74a4f
e77b92a
6a17228
9dc0d48
da0a311
1e906c0
63c14d6
9ac6e00
d339de7
6deab9f
e37fa01
098ba21
36bbf08
412b3b8
c9b2683
e1d03a6
07befbc
fec6a4b
3c65612
59a080f
3563698
699d90f
ff840ff
88c72f8
a6e7a79
8161d58
b6a9155
ce760b6
7483fe5
b3785fd
3e44ebc
316d4e9
d5fe4b4
b0d6e7b
6631890
a086892
0aec763
79d18a1
004b9ea
48633c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
node_modules/ | ||
platforms/ | ||
plugins/ | ||
dist/ | ||
www/lib/ | ||
package-hooks/ | ||
.DS_Store | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { MetaData, BEMData, ServerResponse } from '../js/types/serverData'; | ||
import { LocalDt, MetaData, BEMData, ServerResponse } from '../js/types/serverData'; | ||
import { | ||
CompositeTrip, | ||
ConfirmedPlace, | ||
|
@@ -15,7 +15,7 @@ const mockMetaData: MetaData = { | |
platform: 'test', | ||
time_zone: 'America/Los_Angeles', | ||
write_fmt_time: '1969-07-16T07:01:49.000Z', | ||
write_local_dt: null, | ||
write_local_dt: null as any, | ||
origin_key: '1', | ||
}; | ||
|
||
|
@@ -24,9 +24,9 @@ export const mockLabelOptions: LabelOptions = { | |
PURPOSE: null, | ||
REPLACED_MODE: null, | ||
translations: null, | ||
}; | ||
} as unknown as LabelOptions; | ||
|
||
const mockConfirmedPlaceData: ConfirmedPlace = { | ||
const mockConfirmedPlaceData = { | ||
source: 'DwellSegmentationTimeFilter', | ||
key: null, | ||
origin_key: null, | ||
|
@@ -46,34 +46,30 @@ const mockConfirmedPlaceData: ConfirmedPlace = { | |
raw_places: [null, null], | ||
enter_ts: 1437578093.881, | ||
exit_ts: 1437578093.881, | ||
}; | ||
} as unknown as ConfirmedPlace; | ||
|
||
// using parse/stringify to deep copy & populate data | ||
let tempMetaData = JSON.parse(JSON.stringify(mockMetaData)); | ||
tempMetaData.write_ts = 2; | ||
tempMetaData.origin_key = '2'; | ||
export const mockMetaDataTwo = tempMetaData; | ||
|
||
export const mockUnprocessedTrip: UnprocessedTrip = { | ||
export const mockUnprocessedTrip = { | ||
_id: { $oid: 'mockUnprocessedTrip' }, | ||
additions: [], | ||
confidence_threshold: 0.0, | ||
distance: 1.0, | ||
duration: 3.0, | ||
end_fmt_time: '', | ||
end_loc: { type: 'Point', coordinates: [] }, | ||
end_local_dt: null, | ||
expectation: null, | ||
inferred_labels: [], | ||
key: 'mockUnprocessedTrip', | ||
locations: [], | ||
origin_key: '', | ||
source: '', | ||
start_local_dt: null, | ||
start_ts: 0.1, | ||
start_loc: { type: 'Point', coordinates: [] }, | ||
starting_trip: null, | ||
user_input: null, | ||
}; | ||
} as unknown as UnprocessedTrip; | ||
|
||
export const mockCompData: ServerResponse<CompositeTrip> = { | ||
phone_data: [ | ||
|
@@ -152,7 +148,8 @@ export const mockCompData: ServerResponse<CompositeTrip> = { | |
metadata: mockMetaData, | ||
}, | ||
], | ||
}; | ||
} as unknown as ServerResponse<CompositeTrip>; | ||
|
||
// Setup for second mockData | ||
let newPhoneData = JSON.parse(JSON.stringify(mockCompData.phone_data[0])); | ||
newPhoneData.data._id.$oid = 'mockDataTwo'; | ||
|
@@ -188,18 +185,10 @@ export const mockTransitions: Array<BEMData<TripTransition>> = [ | |
|
||
const mockFilterLocation: FilteredLocation = { | ||
accuracy: 0.1, | ||
altitude: 100, | ||
elapsedRealtimeNanos: 10000, | ||
filter: 'time', | ||
fmt_time: '', | ||
heading: 1.0, | ||
latitude: 1.0, | ||
Comment on lines
-191
to
-195
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why would you remove these? Is it because they are not used in the tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, those properties are not used by the test. If we declare like |
||
loc: null, | ||
local_dt: null, | ||
longitude: -1.0, | ||
sensed_speed: 0, | ||
ts: 100, | ||
}; | ||
} as FilteredLocation; | ||
let mockFilterLocationTwo = JSON.parse(JSON.stringify(mockFilterLocation)); | ||
mockFilterLocationTwo.ts = 900; | ||
mockFilterLocationTwo.longitude = 200; | ||
|
@@ -216,38 +205,31 @@ export const mockFilterLocations: Array<BEMData<FilteredLocation>> = [ | |
}, | ||
]; | ||
|
||
export const mockConfigModeOfStudy: AppConfig = { | ||
server: null, | ||
export const mockConfigModeOfStudy = { | ||
survey_info: { | ||
'trip-labels': 'MULTILABEL', | ||
surveys: null, | ||
}, | ||
intro: { | ||
mode_studied: 'sample_study', | ||
}, | ||
}; | ||
export const mockConfigNoModeOfStudy: AppConfig = { | ||
server: null, | ||
} as AppConfig; | ||
export const mockConfigNoModeOfStudy = { | ||
survey_info: { | ||
'trip-labels': 'MULTILABEL', | ||
surveys: null, | ||
}, | ||
intro: {}, | ||
}; | ||
export const mockConfigEnketo: AppConfig = { | ||
server: null, | ||
} as AppConfig; | ||
export const mockConfigEnketo = { | ||
survey_info: { | ||
'trip-labels': 'ENKETO', | ||
surveys: { | ||
TripConfirmSurvey: { | ||
compatibleWith: 1.2, | ||
formPath: null, | ||
labelTemplate: null, | ||
version: null, | ||
}, | ||
}, | ||
}, | ||
}; | ||
intro: {}, | ||
} as unknown as AppConfig; | ||
|
||
// Used by jest.mocks() to return a various mocked objects. | ||
export const fakeStartTsOne = -14576291; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: do we actually have any tests for i18n? In general, we rely upon the automated tests to catch regressions during upgrades, so it would be good to ensure that it isn't broken. (we can check this visually/manually) for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although we don't specifically test the
i18nextInit.ts
file, some of the tests do invoke it because those tests depend on i18nSo there is coverage for it downstream