Skip to content

Commit 105f26c

Browse files
authored
fix: adjusted tests (#225)
1 parent d82d029 commit 105f26c

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

Diff for: __tests__/steps/measureStep.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ describe('measureStep', () => {
116116
{
117117
detail: {
118118
duration: 100,
119-
type: 'userJourneyStepVital',
119+
type: 'stepVital',
120120
},
121121
end: 100,
122122
start: 100,
@@ -131,7 +131,7 @@ describe('measureStep', () => {
131131
navigationType: undefined,
132132
navigatorInformation: {
133133
deviceMemory: 0,
134-
hardwareConcurrency: 8,
134+
hardwareConcurrency: 12,
135135
isLowEndDevice: false,
136136
isLowEndExperience: false,
137137
serviceWorkerStatus: 'unsupported',

Diff for: __tests__/steps/onMarkJourney.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('markStep', () => {
4040
markStep('loaded_second_screen_first_journey');
4141
expect(onMarkStepSpy).toHaveBeenLastCalledWith(
4242
'loaded_second_screen_first_journey',
43-
['load_second_screen_first_journey'],
43+
[],
4444
);
4545
});
4646
});

Diff for: __tests__/stepsTestConstants.ts

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ export const STEP_THRESHOLDS: IStepsThresholds = {
3232
};
3333

3434
const steps: IStepsConfig = {
35+
load_first_screen_first_journey: {
36+
threshold: IThresholdTier.unavoidable,
37+
marks: ['launch', 'loaded_first_screen_first_journey'],
38+
},
3539
load_second_screen_first_journey: {
3640
threshold: IThresholdTier.instant,
3741
marks: [

Diff for: src/steps/measureStep.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { M, S, WP } from '../constants';
22
import { reportPerf } from '../reportPerf';
33
import { config } from '../config';
44

5-
import { STEP_THRESHOLDS } from '../vitalsScore';
6-
import { getRating } from '../vitalsScore';
5+
import { STEP_THRESHOLDS, getRating } from '../vitalsScore';
76

87
export const measureStep = (
98
step: string,

Diff for: src/steps/measureSteps.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ export const measureSteps = (endMark: string) => {
88
// this is an end mark so we delete the entry
99
const finalSteps = steps.finalMarkToStepsMap[endMark];
1010
Object.keys(finalSteps).forEach(startMark => {
11-
const steps = finalSteps[startMark];
12-
steps.forEach(removeActiveStep);
11+
const possibleSteps = finalSteps[startMark];
12+
possibleSteps.forEach(removeActiveStep);
1313
Promise.all(
14-
steps.map(async step => {
14+
possibleSteps.map(async step => {
1515
// measure
1616
await measureStep(step, startMark, endMark);
1717
}),

0 commit comments

Comments
 (0)