@syntrologie/adapt-nav 2.2.0-canary.13 → 2.2.0-canary.14

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.
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { fireEvent, render } from '@testing-library/react';
2
+ import { render } from '@testing-library/react';
3
3
  import { describe, expect, it, vi } from 'vitest';
4
4
  import { EditorHeader } from '../components/EditorHeader';
5
5
  describe('EditorHeader', () => {
@@ -15,10 +15,9 @@ describe('EditorHeader', () => {
15
15
  const { queryByText } = render(_jsx(EditorHeader, { title: "T", onBack: () => { } }));
16
16
  expect(queryByText('Sub')).toBeNull();
17
17
  });
18
- it('calls onBack when back button is clicked', () => {
18
+ it('accepts deprecated onBack prop without rendering a back button', () => {
19
19
  const onBack = vi.fn();
20
- const { getByText } = render(_jsx(EditorHeader, { title: "T", onBack: onBack }));
21
- fireEvent.click(getByText('← Back'));
22
- expect(onBack).toHaveBeenCalledOnce();
20
+ const { queryByText } = render(_jsx(EditorHeader, { title: "T", onBack: onBack }));
21
+ expect(queryByText('← Back')).toBeNull();
23
22
  });
24
23
  });
@@ -1,26 +1,28 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { describe, it, expect } from 'vitest';
3
2
  import { render, screen } from '@testing-library/react';
3
+ import { describe, expect, it } from 'vitest';
4
4
  import { TriggerJourney } from '../components/TriggerJourney';
5
5
  describe('TriggerJourney', () => {
6
- it('returns null when status is null', () => {
7
- const { container } = render(_jsx(TriggerJourney, { status: null }));
8
- expect(container.innerHTML).toBe('');
6
+ it('renders "Always Present" when status is null', () => {
7
+ render(_jsx(TriggerJourney, { status: null }));
8
+ expect(screen.getByText('Always Present')).toBeTruthy();
9
9
  });
10
- it('returns null when conditions array is empty', () => {
10
+ it('renders "Always Present" when conditions array is empty', () => {
11
11
  const status = { visible: true, isFallback: true, conditions: [] };
12
- const { container } = render(_jsx(TriggerJourney, { status: status }));
13
- expect(container.innerHTML).toBe('');
12
+ render(_jsx(TriggerJourney, { status: status }));
13
+ expect(screen.getByText('Always Present')).toBeTruthy();
14
14
  });
15
15
  it('renders a single node for one condition', () => {
16
16
  const status = {
17
17
  visible: true,
18
18
  isFallback: false,
19
- conditions: [{
19
+ conditions: [
20
+ {
20
21
  type: 'page_url',
21
22
  passed: true,
22
23
  formatted: { label: '/pricing', instruction: 'Visit /pricing', shortLabel: '/pricing' },
23
- }],
24
+ },
25
+ ],
24
26
  };
25
27
  render(_jsx(TriggerJourney, { status: status }));
26
28
  expect(screen.getByText('/pricing')).toBeTruthy();
@@ -33,7 +35,11 @@ describe('TriggerJourney', () => {
33
35
  {
34
36
  type: 'page_url',
35
37
  passed: true,
36
- formatted: { label: '/fine-arts/', instruction: 'Visit a /fine-arts/ page', shortLabel: '/fine-arts/' },
38
+ formatted: {
39
+ label: '/fine-arts/',
40
+ instruction: 'Visit a /fine-arts/ page',
41
+ shortLabel: '/fine-arts/',
42
+ },
37
43
  },
38
44
  {
39
45
  type: 'event_count',
@@ -57,7 +63,8 @@ describe('TriggerJourney', () => {
57
63
  const status = {
58
64
  visible: false,
59
65
  isFallback: false,
60
- conditions: [{
66
+ conditions: [
67
+ {
61
68
  type: 'event_count',
62
69
  passed: false,
63
70
  formatted: {
@@ -66,7 +73,8 @@ describe('TriggerJourney', () => {
66
73
  shortLabel: '3+ clicks',
67
74
  progress: { current: 1, target: 3, operator: 'gte' },
68
75
  },
69
- }],
76
+ },
77
+ ],
70
78
  };
71
79
  render(_jsx(TriggerJourney, { status: status }));
72
80
  expect(screen.getByText('1/3')).toBeTruthy();
@@ -113,11 +121,13 @@ describe('TriggerJourney', () => {
113
121
  const status = {
114
122
  visible: false,
115
123
  isFallback: false,
116
- conditions: [{
124
+ conditions: [
125
+ {
117
126
  type: 'page_url',
118
127
  passed: false,
119
128
  formatted: { label: '/p', instruction: 'Visit /pricing page', shortLabel: '/pricing' },
120
- }],
129
+ },
130
+ ],
121
131
  };
122
132
  render(_jsx(TriggerJourney, { status: status }));
123
133
  const label = screen.getByText('/pricing');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syntrologie/adapt-nav",
3
- "version": "2.2.0-canary.13",
3
+ "version": "2.2.0-canary.14",
4
4
  "description": "Adaptive Navigation - Nav link widget, scroll-to and page navigation actions",
5
5
  "license": "Proprietary",
6
6
  "private": false,