@applicaster/quick-brick-core 16.0.0-rc.100 → 16.0.0-rc.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -353,10 +353,7 @@ export function NavigationProvider({ children }: Props) {
353
353
  state: firstRoute.state,
354
354
  };
355
355
 
356
- if (
357
- stateForBack?.state?.entry &&
358
- "home" in stateForBack?.state?.entry
359
- ) {
356
+ if (stateForBack?.state?.entry?.home) {
360
357
  goHome();
361
358
  } else {
362
359
  dispatch(back(stateForBack));
@@ -410,6 +410,62 @@ describe("<NavigationProvider />", () => {
410
410
  });
411
411
  });
412
412
 
413
+ describe("when backToTop is requested from a non-home tab", () => {
414
+ const listenRiver = {
415
+ id: "LISTEN",
416
+ home: false,
417
+ navigations: [],
418
+ ui_components: [],
419
+ };
420
+
421
+ beforeEach(() => {
422
+ wrapper = renderContextConsumer({
423
+ ...store,
424
+ rivers: { ...rivers, LISTEN: listenRiver },
425
+ });
426
+
427
+ act(() => {
428
+ getNavigatorValues(wrapper).navigator.replace(listenRiver);
429
+ });
430
+ });
431
+
432
+ it("returns to the tab root from the second level", () => {
433
+ act(() => {
434
+ getNavigatorValues(wrapper).navigator.push(rivers.A1234);
435
+ });
436
+
437
+ act(() => {
438
+ getNavigatorValues(wrapper).navigator.goBack(false, false, true);
439
+ });
440
+
441
+ const { navigator, state } = getNavigatorValues(wrapper);
442
+
443
+ expect(navigator.currentRoute).toEqual("/river/LISTEN");
444
+ expect(navigator.activeRiver).toEqual(listenRiver);
445
+ expect(state.stack.mainStack).toHaveLength(1);
446
+ });
447
+
448
+ it("returns to the tab root from the third level", () => {
449
+ act(() => {
450
+ getNavigatorValues(wrapper).navigator.push(rivers.A1234);
451
+ });
452
+
453
+ act(() => {
454
+ getNavigatorValues(wrapper).navigator.push(rivers.C0987);
455
+ });
456
+
457
+ act(() => {
458
+ getNavigatorValues(wrapper).navigator.goBack(false, false, true);
459
+ });
460
+
461
+ const { navigator, state } = getNavigatorValues(wrapper);
462
+
463
+ expect(navigator.currentRoute).toEqual("/river/LISTEN");
464
+ expect(navigator.activeRiver).toEqual(listenRiver);
465
+ expect(state.stack.mainStack).toHaveLength(1);
466
+ });
467
+ });
468
+
413
469
  describe("when there is a previous route and there are hooks", () => {
414
470
  beforeEach(() => {
415
471
  wrapper = renderContextConsumer();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-core",
3
- "version": "16.0.0-rc.100",
3
+ "version": "16.0.0-rc.102",
4
4
  "description": "Core package for Applicaster's Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,13 +28,13 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "16.0.0-rc.100",
32
- "@applicaster/quick-brick-core-plugins": "16.0.0-rc.100",
33
- "@applicaster/zapp-pipes-v2-client": "16.0.0-rc.100",
34
- "@applicaster/zapp-react-native-bridge": "16.0.0-rc.100",
35
- "@applicaster/zapp-react-native-redux": "16.0.0-rc.100",
36
- "@applicaster/zapp-react-native-ui-components": "16.0.0-rc.100",
37
- "@applicaster/zapp-react-native-utils": "16.0.0-rc.100",
31
+ "@applicaster/applicaster-types": "16.0.0-rc.102",
32
+ "@applicaster/quick-brick-core-plugins": "16.0.0-rc.102",
33
+ "@applicaster/zapp-pipes-v2-client": "16.0.0-rc.102",
34
+ "@applicaster/zapp-react-native-bridge": "16.0.0-rc.102",
35
+ "@applicaster/zapp-react-native-redux": "16.0.0-rc.102",
36
+ "@applicaster/zapp-react-native-ui-components": "16.0.0-rc.102",
37
+ "@applicaster/zapp-react-native-utils": "16.0.0-rc.102",
38
38
  "atob": "^2.1.2",
39
39
  "axios": "^0.28.0",
40
40
  "btoa": "^1.2.1",