Skip to content

Commit b7e434c

Browse files
committed
test: Updated V4 tests
1 parent 0acb17c commit b7e434c

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

test/tracing/reactnavigationv4.test.ts

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ import {
66
ReactNavigationV4Instrumentation,
77
} from "../../src/js/tracing/reactnavigationv4";
88

9+
const initialRoute = {
10+
routeName: "Initial Route",
11+
key: "route0",
12+
params: {
13+
hello: true,
14+
},
15+
};
16+
917
class MockAppContainer implements AppContainerInstance {
1018
_navigation: {
1119
state: NavigationStateV4;
@@ -53,15 +61,7 @@ class MockAppContainer implements AppContainerInstance {
5361
index: 0,
5462
key: "0",
5563
isTransitioning: false,
56-
routes: [
57-
{
58-
routeName: "Initial Route",
59-
key: "route0",
60-
params: {
61-
hello: true,
62-
},
63-
},
64-
],
64+
routes: [initialRoute],
6565
},
6666
router,
6767
};
@@ -158,7 +158,13 @@ describe("ReactNavigationV4Instrumentation", () => {
158158
params: action.params,
159159
hasBeenSeen: false,
160160
},
161-
previousRoute: null,
161+
previousRoute: {
162+
name: "Initial Route",
163+
key: "route0",
164+
params: {
165+
hello: true,
166+
},
167+
},
162168
},
163169
});
164170
});
@@ -210,7 +216,13 @@ describe("ReactNavigationV4Instrumentation", () => {
210216
params: action.params,
211217
hasBeenSeen: false,
212218
},
213-
previousRoute: null,
219+
previousRoute: {
220+
name: "Initial Route",
221+
key: "route0",
222+
params: {
223+
hello: true,
224+
},
225+
},
214226
},
215227
sampled: false,
216228
});

0 commit comments

Comments
 (0)