@applicaster/quick-brick-core 15.1.16-rc.0 → 15.1.16-rc.1

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.
@@ -356,10 +356,7 @@ export function NavigationProvider({ children }: Props) {
356
356
  state: firstRoute.state,
357
357
  };
358
358
 
359
- if (
360
- stateForBack?.state?.entry &&
361
- "home" in stateForBack?.state?.entry
362
- ) {
359
+ if (stateForBack?.state?.entry?.home) {
363
360
  goHome();
364
361
  } else {
365
362
  dispatch(back(stateForBack));
@@ -423,6 +423,60 @@ describe("<NavigationProvider />", () => {
423
423
  });
424
424
  });
425
425
 
426
+ describe("when backToTop is requested from a non-home tab", () => {
427
+ const listenRiver = {
428
+ id: "LISTEN",
429
+ home: false,
430
+ navigations: [],
431
+ ui_components: [],
432
+ hooks: {
433
+ preload_plugins: [],
434
+ postload_plugins: [],
435
+ },
436
+ };
437
+
438
+ beforeEach(() => {
439
+ rivers.LISTEN = listenRiver;
440
+
441
+ act(() => {
442
+ wrapper = renderContextConsumer();
443
+ });
444
+
445
+ act(() => {
446
+ getByTestId(wrapper, "WrapperView").props.navigator.replace(
447
+ listenRiver
448
+ );
449
+ });
450
+ });
451
+
452
+ afterEach(() => {
453
+ delete rivers.LISTEN;
454
+ });
455
+
456
+ it("returns to the tab root from the second level", () => {
457
+ const view = getByTestId(wrapper, "WrapperView");
458
+
459
+ act(() => view.props.navigator.push(rivers.A1234));
460
+ act(() => view.props.navigator.goBack(false, false, true));
461
+
462
+ expect(view.props.navigator.currentRoute).toEqual("/river/LISTEN");
463
+ expect(view.props.navigator.activeRiver).toEqual(listenRiver);
464
+ expect(view.props.state.stack.mainStack).toHaveLength(1);
465
+ });
466
+
467
+ it("returns to the tab root from the third level", () => {
468
+ const view = getByTestId(wrapper, "WrapperView");
469
+
470
+ act(() => view.props.navigator.push(rivers.A1234));
471
+ act(() => view.props.navigator.push(rivers.C0987));
472
+ act(() => view.props.navigator.goBack(false, false, true));
473
+
474
+ expect(view.props.navigator.currentRoute).toEqual("/river/LISTEN");
475
+ expect(view.props.navigator.activeRiver).toEqual(listenRiver);
476
+ expect(view.props.state.stack.mainStack).toHaveLength(1);
477
+ });
478
+ });
479
+
426
480
  describe("when there is a previous route and there are hooks", () => {
427
481
  act(() => {
428
482
  wrapper = renderContextConsumer();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-core",
3
- "version": "15.1.16-rc.0",
3
+ "version": "15.1.16-rc.1",
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": "15.1.16-rc.0",
32
- "@applicaster/quick-brick-core-plugins": "15.1.16-rc.0",
33
- "@applicaster/zapp-pipes-v2-client": "15.1.16-rc.0",
34
- "@applicaster/zapp-react-native-bridge": "15.1.16-rc.0",
35
- "@applicaster/zapp-react-native-redux": "15.1.16-rc.0",
36
- "@applicaster/zapp-react-native-ui-components": "15.1.16-rc.0",
37
- "@applicaster/zapp-react-native-utils": "15.1.16-rc.0",
31
+ "@applicaster/applicaster-types": "15.1.16-rc.1",
32
+ "@applicaster/quick-brick-core-plugins": "15.1.16-rc.1",
33
+ "@applicaster/zapp-pipes-v2-client": "15.1.16-rc.1",
34
+ "@applicaster/zapp-react-native-bridge": "15.1.16-rc.1",
35
+ "@applicaster/zapp-react-native-redux": "15.1.16-rc.1",
36
+ "@applicaster/zapp-react-native-ui-components": "15.1.16-rc.1",
37
+ "@applicaster/zapp-react-native-utils": "15.1.16-rc.1",
38
38
  "atob": "^2.1.2",
39
39
  "axios": "^0.28.0",
40
40
  "btoa": "^1.2.1",