@syntrologie/adapt-nav 2.5.1 → 2.6.0-canary.2
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.
- package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.js +22 -153
- package/node_modules/@syntrologie/shared-editor-ui/package.json +2 -2
- package/package.json +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/AnchorPicker.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/AnchorPicker.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/AnchorPicker.test.js +0 -224
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/BeforeAfterToggle.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/BeforeAfterToggle.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/BeforeAfterToggle.test.js +0 -29
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ConditionStatusLine.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ConditionStatusLine.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ConditionStatusLine.test.js +0 -260
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DetectionBadge.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DetectionBadge.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DetectionBadge.test.js +0 -70
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DismissedSection.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DismissedSection.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DismissedSection.test.js +0 -46
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditBackButton.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditBackButton.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditBackButton.test.js +0 -20
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorBody.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorBody.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorBody.test.js +0 -12
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorCard.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorCard.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorCard.test.js +0 -84
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorFooter.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorFooter.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorFooter.test.js +0 -23
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorHeader.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorHeader.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorHeader.test.js +0 -23
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorInput.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorInput.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorInput.test.js +0 -26
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorLayout.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorLayout.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorLayout.test.js +0 -13
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorPanelShell.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorPanelShell.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorPanelShell.test.js +0 -496
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorSelect.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorSelect.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorSelect.test.js +0 -22
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorTextarea.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorTextarea.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorTextarea.test.js +0 -20
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ElementHighlight.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ElementHighlight.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ElementHighlight.test.js +0 -176
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EmptyState.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EmptyState.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EmptyState.test.js +0 -10
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/GroupHeader.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/GroupHeader.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/GroupHeader.test.js +0 -14
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/TriggerJourney.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/TriggerJourney.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/TriggerJourney.test.js +0 -189
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/cn.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/cn.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/cn.test.js +0 -16
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/formatConditionLabel.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/formatConditionLabel.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/formatConditionLabel.test.js +0 -329
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/selectorGenerator.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/selectorGenerator.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/selectorGenerator.test.js +0 -257
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useElementRect.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useElementRect.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useElementRect.test.js +0 -112
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useTriggerWhenStatus.test.d.ts +0 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useTriggerWhenStatus.test.d.ts.map +0 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useTriggerWhenStatus.test.js +0 -1015
package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ConditionStatusLine.test.js
DELETED
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { fireEvent, render, screen } from '@testing-library/react';
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import { ConditionStatusLine } from '../components/ConditionStatusLine';
|
|
5
|
-
describe('ConditionStatusLine', () => {
|
|
6
|
-
it('returns null when status is null', () => {
|
|
7
|
-
const { container } = render(_jsx(ConditionStatusLine, { status: null }));
|
|
8
|
-
expect(container.innerHTML).toBe('');
|
|
9
|
-
});
|
|
10
|
-
it('renders single condition inline', () => {
|
|
11
|
-
const status = {
|
|
12
|
-
visible: true,
|
|
13
|
-
isFallback: false,
|
|
14
|
-
conditions: [
|
|
15
|
-
{
|
|
16
|
-
type: 'page_url',
|
|
17
|
-
passed: true,
|
|
18
|
-
formatted: { label: '/pricing', instruction: 'Visit /pricing', shortLabel: '/pricing' },
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
};
|
|
22
|
-
render(_jsx(ConditionStatusLine, { status: status }));
|
|
23
|
-
expect(screen.getByText('page_url:')).toBeTruthy();
|
|
24
|
-
expect(screen.getByText('/pricing')).toBeTruthy();
|
|
25
|
-
});
|
|
26
|
-
it('uses at least 12px font size for condition rows', () => {
|
|
27
|
-
const status = {
|
|
28
|
-
visible: true,
|
|
29
|
-
isFallback: false,
|
|
30
|
-
conditions: [
|
|
31
|
-
{
|
|
32
|
-
type: 'page_url',
|
|
33
|
-
passed: true,
|
|
34
|
-
formatted: { label: '/pricing', instruction: 'Visit /pricing', shortLabel: '/pricing' },
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
};
|
|
38
|
-
const { container } = render(_jsx(ConditionStatusLine, { status: status }));
|
|
39
|
-
const row = container.firstElementChild;
|
|
40
|
-
expect(row.className).toContain('se-text-[12px]');
|
|
41
|
-
expect(row.className).not.toContain('se-text-[10px]');
|
|
42
|
-
});
|
|
43
|
-
it('uses secondary text color for readability', () => {
|
|
44
|
-
const status = {
|
|
45
|
-
visible: true,
|
|
46
|
-
isFallback: false,
|
|
47
|
-
conditions: [
|
|
48
|
-
{
|
|
49
|
-
type: 'page_url',
|
|
50
|
-
passed: true,
|
|
51
|
-
formatted: { label: '/pricing', instruction: 'Visit /pricing', shortLabel: '/pricing' },
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
};
|
|
55
|
-
const { container } = render(_jsx(ConditionStatusLine, { status: status }));
|
|
56
|
-
const row = container.firstElementChild;
|
|
57
|
-
expect(row.className).toContain('se-text-text-secondary');
|
|
58
|
-
});
|
|
59
|
-
it('uses medium font weight for small text', () => {
|
|
60
|
-
const status = {
|
|
61
|
-
visible: true,
|
|
62
|
-
isFallback: false,
|
|
63
|
-
conditions: [
|
|
64
|
-
{
|
|
65
|
-
type: 'page_url',
|
|
66
|
-
passed: true,
|
|
67
|
-
formatted: { label: '/pricing', instruction: 'Visit /pricing', shortLabel: '/pricing' },
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
};
|
|
71
|
-
const { container } = render(_jsx(ConditionStatusLine, { status: status }));
|
|
72
|
-
const row = container.firstElementChild;
|
|
73
|
-
expect(row.className).toContain('se-font-medium');
|
|
74
|
-
});
|
|
75
|
-
it('renders multi-condition summary with expand button', () => {
|
|
76
|
-
const status = {
|
|
77
|
-
visible: false,
|
|
78
|
-
isFallback: false,
|
|
79
|
-
conditions: [
|
|
80
|
-
{
|
|
81
|
-
type: 'page_url',
|
|
82
|
-
passed: true,
|
|
83
|
-
formatted: { label: '/p', instruction: 'A', shortLabel: 'A' },
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
type: 'event_count',
|
|
87
|
-
passed: false,
|
|
88
|
-
formatted: { label: 'views >= 2', instruction: 'B', shortLabel: 'B' },
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
};
|
|
92
|
-
render(_jsx(ConditionStatusLine, { status: status }));
|
|
93
|
-
expect(screen.getByText('1 of 2 conditions met')).toBeTruthy();
|
|
94
|
-
});
|
|
95
|
-
it('uses at least 11px for expand indicator', () => {
|
|
96
|
-
const status = {
|
|
97
|
-
visible: false,
|
|
98
|
-
isFallback: false,
|
|
99
|
-
conditions: [
|
|
100
|
-
{
|
|
101
|
-
type: 'a',
|
|
102
|
-
passed: true,
|
|
103
|
-
formatted: { label: 'a', instruction: 'A', shortLabel: 'A' },
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
type: 'b',
|
|
107
|
-
passed: false,
|
|
108
|
-
formatted: { label: 'b', instruction: 'B', shortLabel: 'B' },
|
|
109
|
-
},
|
|
110
|
-
],
|
|
111
|
-
};
|
|
112
|
-
const { container } = render(_jsx(ConditionStatusLine, { status: status }));
|
|
113
|
-
// The expand indicator is the last span in the button
|
|
114
|
-
const button = container.querySelector('button');
|
|
115
|
-
const indicator = button.querySelector('span:last-child');
|
|
116
|
-
expect(indicator.className).toContain('se-text-[11px]');
|
|
117
|
-
expect(indicator.className).not.toContain('se-text-[8px]');
|
|
118
|
-
});
|
|
119
|
-
it('expands to show individual condition rows on click', () => {
|
|
120
|
-
const status = {
|
|
121
|
-
visible: false,
|
|
122
|
-
isFallback: false,
|
|
123
|
-
conditions: [
|
|
124
|
-
{
|
|
125
|
-
type: 'page_url',
|
|
126
|
-
passed: true,
|
|
127
|
-
formatted: { label: '/p', instruction: 'A', shortLabel: 'A' },
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
type: 'event_count',
|
|
131
|
-
passed: false,
|
|
132
|
-
formatted: { label: 'views >= 2', instruction: 'B', shortLabel: 'B' },
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
};
|
|
136
|
-
render(_jsx(ConditionStatusLine, { status: status }));
|
|
137
|
-
fireEvent.click(screen.getByText('1 of 2 conditions met'));
|
|
138
|
-
expect(screen.getByText('page_url:')).toBeTruthy();
|
|
139
|
-
expect(screen.getByText('event_count:')).toBeTruthy();
|
|
140
|
-
});
|
|
141
|
-
it('uses secondary color (not tertiary) for condition detail labels', () => {
|
|
142
|
-
const status = {
|
|
143
|
-
visible: true,
|
|
144
|
-
isFallback: false,
|
|
145
|
-
conditions: [
|
|
146
|
-
{
|
|
147
|
-
type: 'page_url',
|
|
148
|
-
passed: true,
|
|
149
|
-
formatted: { label: '/pricing', instruction: 'Visit /pricing', shortLabel: '/pricing' },
|
|
150
|
-
},
|
|
151
|
-
],
|
|
152
|
-
};
|
|
153
|
-
render(_jsx(ConditionStatusLine, { status: status }));
|
|
154
|
-
const label = screen.getByText('/pricing');
|
|
155
|
-
expect(label.className).toContain('se-text-text-secondary');
|
|
156
|
-
expect(label.className).not.toContain('se-text-text-tertiary');
|
|
157
|
-
});
|
|
158
|
-
it('renders progress bar for single condition with progress data', () => {
|
|
159
|
-
const status = {
|
|
160
|
-
visible: false,
|
|
161
|
-
isFallback: false,
|
|
162
|
-
conditions: [
|
|
163
|
-
{
|
|
164
|
-
type: 'event_count',
|
|
165
|
-
passed: false,
|
|
166
|
-
formatted: {
|
|
167
|
-
label: 'views >= 5',
|
|
168
|
-
instruction: 'View pages 5+ times',
|
|
169
|
-
shortLabel: 'View 5+ times',
|
|
170
|
-
progress: { current: 2, target: 5, operator: 'gte' },
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
],
|
|
174
|
-
};
|
|
175
|
-
const { container } = render(_jsx(ConditionStatusLine, { status: status }));
|
|
176
|
-
// Progress bar has a title with current/target
|
|
177
|
-
const progressBar = container.querySelector('[title]');
|
|
178
|
-
expect(progressBar).toBeTruthy();
|
|
179
|
-
expect(progressBar.title).toContain('2/5');
|
|
180
|
-
// Also shows numeric progress
|
|
181
|
-
expect(screen.getByText('2/5')).toBeTruthy();
|
|
182
|
-
});
|
|
183
|
-
it('renders progress bar at 100% with green color', () => {
|
|
184
|
-
const status = {
|
|
185
|
-
visible: true,
|
|
186
|
-
isFallback: false,
|
|
187
|
-
conditions: [
|
|
188
|
-
{
|
|
189
|
-
type: 'event_count',
|
|
190
|
-
passed: true,
|
|
191
|
-
formatted: {
|
|
192
|
-
label: 'clicks >= 3',
|
|
193
|
-
instruction: 'Click 3+ times',
|
|
194
|
-
shortLabel: '3+ clicks',
|
|
195
|
-
progress: { current: 5, target: 3, operator: 'gte' },
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
],
|
|
199
|
-
};
|
|
200
|
-
const { container } = render(_jsx(ConditionStatusLine, { status: status }));
|
|
201
|
-
const progressBar = container.querySelector('[title]');
|
|
202
|
-
expect(progressBar).toBeTruthy();
|
|
203
|
-
// 100% cap
|
|
204
|
-
expect(progressBar.title).toContain('100%');
|
|
205
|
-
// The inner bar should have green background
|
|
206
|
-
const innerBar = progressBar.firstElementChild;
|
|
207
|
-
expect(innerBar.className).toContain('se-bg-green-4');
|
|
208
|
-
});
|
|
209
|
-
it('renders progress bar with blue color when not at 100%', () => {
|
|
210
|
-
const status = {
|
|
211
|
-
visible: false,
|
|
212
|
-
isFallback: false,
|
|
213
|
-
conditions: [
|
|
214
|
-
{
|
|
215
|
-
type: 'event_count',
|
|
216
|
-
passed: false,
|
|
217
|
-
formatted: {
|
|
218
|
-
label: 'clicks >= 10',
|
|
219
|
-
instruction: 'Click 10+ times',
|
|
220
|
-
shortLabel: '10+ clicks',
|
|
221
|
-
progress: { current: 3, target: 10, operator: 'gte' },
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
|
-
],
|
|
225
|
-
};
|
|
226
|
-
const { container } = render(_jsx(ConditionStatusLine, { status: status }));
|
|
227
|
-
const progressBar = container.querySelector('[title]');
|
|
228
|
-
const innerBar = progressBar.firstElementChild;
|
|
229
|
-
expect(innerBar.className).toContain('se-bg-blue-4');
|
|
230
|
-
expect(innerBar.className).not.toContain('se-bg-green-4');
|
|
231
|
-
});
|
|
232
|
-
it('renders progress bar in expanded multi-condition rows', () => {
|
|
233
|
-
const status = {
|
|
234
|
-
visible: false,
|
|
235
|
-
isFallback: false,
|
|
236
|
-
conditions: [
|
|
237
|
-
{
|
|
238
|
-
type: 'page_url',
|
|
239
|
-
passed: true,
|
|
240
|
-
formatted: { label: '/p', instruction: 'A', shortLabel: 'A' },
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
type: 'event_count',
|
|
244
|
-
passed: false,
|
|
245
|
-
formatted: {
|
|
246
|
-
label: 'views >= 5',
|
|
247
|
-
instruction: 'B',
|
|
248
|
-
shortLabel: 'B',
|
|
249
|
-
progress: { current: 2, target: 5, operator: 'gte' },
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
|
-
],
|
|
253
|
-
};
|
|
254
|
-
render(_jsx(ConditionStatusLine, { status: status }));
|
|
255
|
-
// Expand
|
|
256
|
-
fireEvent.click(screen.getByText('1 of 2 conditions met'));
|
|
257
|
-
// Progress bar should appear in the expanded section
|
|
258
|
-
expect(screen.getByText('2/5')).toBeTruthy();
|
|
259
|
-
});
|
|
260
|
-
});
|
package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DetectionBadge.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DetectionBadge.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/DetectionBadge.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { fireEvent, render } from '@testing-library/react';
|
|
3
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
4
|
-
import { DetectionBadge } from '../components/DetectionBadge';
|
|
5
|
-
describe('DetectionBadge', () => {
|
|
6
|
-
it('displays "GoTo" text', () => {
|
|
7
|
-
const { container } = render(_jsx(DetectionBadge, { found: true }));
|
|
8
|
-
expect(container.textContent).toBe('GoTo');
|
|
9
|
-
});
|
|
10
|
-
it('uses green text color when found is true', () => {
|
|
11
|
-
const { container } = render(_jsx(DetectionBadge, { found: true }));
|
|
12
|
-
const badge = container.firstElementChild;
|
|
13
|
-
expect(badge.className).toContain('se-text-green-4');
|
|
14
|
-
expect(badge.title).toBe('Found on this page');
|
|
15
|
-
});
|
|
16
|
-
it('uses muted text color when found is false', () => {
|
|
17
|
-
const { container } = render(_jsx(DetectionBadge, { found: false }));
|
|
18
|
-
const badge = container.firstElementChild;
|
|
19
|
-
expect(badge.className).toContain('se-text-text-tertiary');
|
|
20
|
-
expect(badge.title).toBe('Not found on this page');
|
|
21
|
-
});
|
|
22
|
-
it('renders a <span> when no onClick is provided', () => {
|
|
23
|
-
const { container } = render(_jsx(DetectionBadge, { found: true }));
|
|
24
|
-
const badge = container.firstElementChild;
|
|
25
|
-
expect(badge.tagName).toBe('SPAN');
|
|
26
|
-
});
|
|
27
|
-
it('renders a <button> when onClick is provided', () => {
|
|
28
|
-
const { container } = render(_jsx(DetectionBadge, { found: true, onClick: () => { } }));
|
|
29
|
-
const badge = container.firstElementChild;
|
|
30
|
-
expect(badge.tagName).toBe('BUTTON');
|
|
31
|
-
});
|
|
32
|
-
it('calls onClick when clicked', () => {
|
|
33
|
-
const onClick = vi.fn();
|
|
34
|
-
const { container } = render(_jsx(DetectionBadge, { found: true, onClick: onClick }));
|
|
35
|
-
const badge = container.firstElementChild;
|
|
36
|
-
fireEvent.click(badge);
|
|
37
|
-
expect(onClick).toHaveBeenCalledTimes(1);
|
|
38
|
-
});
|
|
39
|
-
it('calls stopPropagation so clicks do not bubble to parent card', () => {
|
|
40
|
-
const onClick = vi.fn();
|
|
41
|
-
const parentClick = vi.fn();
|
|
42
|
-
const { container } = render(
|
|
43
|
-
// biome-ignore lint/a11y/useKeyWithClickEvents: test wrapper
|
|
44
|
-
_jsx("div", { onClick: parentClick, children: _jsx(DetectionBadge, { found: false, onClick: onClick }) }));
|
|
45
|
-
const badge = container.querySelector('button');
|
|
46
|
-
fireEvent.click(badge);
|
|
47
|
-
expect(onClick).toHaveBeenCalledTimes(1);
|
|
48
|
-
expect(parentClick).not.toHaveBeenCalled();
|
|
49
|
-
});
|
|
50
|
-
it('shows "Click to scroll to element" title when onClick + found', () => {
|
|
51
|
-
const { container } = render(_jsx(DetectionBadge, { found: true, onClick: () => { } }));
|
|
52
|
-
const badge = container.firstElementChild;
|
|
53
|
-
expect(badge.title).toBe('Click to scroll to element');
|
|
54
|
-
});
|
|
55
|
-
it('shows "Click to navigate to page" title when onClick + not found', () => {
|
|
56
|
-
const { container } = render(_jsx(DetectionBadge, { found: false, onClick: () => { } }));
|
|
57
|
-
const badge = container.firstElementChild;
|
|
58
|
-
expect(badge.title).toBe('Click to navigate to page');
|
|
59
|
-
});
|
|
60
|
-
it('has green indicator dot when found', () => {
|
|
61
|
-
const { container } = render(_jsx(DetectionBadge, { found: true }));
|
|
62
|
-
const dot = container.querySelector('[data-indicator]');
|
|
63
|
-
expect(dot.className).toContain('se-bg-green-4');
|
|
64
|
-
});
|
|
65
|
-
it('has muted indicator dot when not found', () => {
|
|
66
|
-
const { container } = render(_jsx(DetectionBadge, { found: false }));
|
|
67
|
-
const dot = container.querySelector('[data-indicator]');
|
|
68
|
-
expect(dot.className).toContain('se-bg-text-tertiary');
|
|
69
|
-
});
|
|
70
|
-
});
|
package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DismissedSection.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DismissedSection.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/DismissedSection.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { fireEvent, render } from '@testing-library/react';
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import { DismissedSection } from '../components/DismissedSection';
|
|
5
|
-
describe('DismissedSection', () => {
|
|
6
|
-
it('is collapsed by default (children hidden)', () => {
|
|
7
|
-
const { queryByText } = render(_jsx(DismissedSection, { count: 3, children: _jsx("span", { children: "hidden content" }) }));
|
|
8
|
-
expect(queryByText('hidden content')).toBeNull();
|
|
9
|
-
});
|
|
10
|
-
it('expands on click to show children', () => {
|
|
11
|
-
const { getByText, queryByText } = render(_jsx(DismissedSection, { count: 2, children: _jsx("span", { children: "revealed" }) }));
|
|
12
|
-
fireEvent.click(getByText('Dismissed (2)'));
|
|
13
|
-
expect(queryByText('revealed')).toBeTruthy();
|
|
14
|
-
});
|
|
15
|
-
it('uses secondary text color for readability', () => {
|
|
16
|
-
const { getByText } = render(_jsx(DismissedSection, { count: 2, children: _jsx("span", { children: "child" }) }));
|
|
17
|
-
const button = getByText('Dismissed (2)').closest('[role="button"]');
|
|
18
|
-
expect(button.className).toContain('se-text-text-secondary');
|
|
19
|
-
expect(button.className).not.toContain('se-text-text-tertiary');
|
|
20
|
-
});
|
|
21
|
-
it('collapses again on second click', () => {
|
|
22
|
-
const { getByText, queryByText } = render(_jsx(DismissedSection, { count: 1, children: _jsx("span", { children: "content" }) }));
|
|
23
|
-
fireEvent.click(getByText('Dismissed (1)'));
|
|
24
|
-
expect(queryByText('content')).toBeTruthy();
|
|
25
|
-
fireEvent.click(getByText('Dismissed (1)'));
|
|
26
|
-
expect(queryByText('content')).toBeNull();
|
|
27
|
-
});
|
|
28
|
-
it('expands on Enter keydown', () => {
|
|
29
|
-
const { getByText, queryByText } = render(_jsx(DismissedSection, { count: 2, children: _jsx("span", { children: "keyboard content" }) }));
|
|
30
|
-
const button = getByText('Dismissed (2)').closest('[role="button"]');
|
|
31
|
-
fireEvent.keyDown(button, { key: 'Enter' });
|
|
32
|
-
expect(queryByText('keyboard content')).toBeTruthy();
|
|
33
|
-
});
|
|
34
|
-
it('expands on Space keydown', () => {
|
|
35
|
-
const { getByText, queryByText } = render(_jsx(DismissedSection, { count: 2, children: _jsx("span", { children: "space content" }) }));
|
|
36
|
-
const button = getByText('Dismissed (2)').closest('[role="button"]');
|
|
37
|
-
fireEvent.keyDown(button, { key: ' ' });
|
|
38
|
-
expect(queryByText('space content')).toBeTruthy();
|
|
39
|
-
});
|
|
40
|
-
it('does not expand on other key presses', () => {
|
|
41
|
-
const { getByText, queryByText } = render(_jsx(DismissedSection, { count: 2, children: _jsx("span", { children: "other key content" }) }));
|
|
42
|
-
const button = getByText('Dismissed (2)').closest('[role="button"]');
|
|
43
|
-
fireEvent.keyDown(button, { key: 'Tab' });
|
|
44
|
-
expect(queryByText('other key content')).toBeNull();
|
|
45
|
-
});
|
|
46
|
-
});
|
package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditBackButton.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditBackButton.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditBackButton.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { fireEvent, render } from '@testing-library/react';
|
|
3
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
4
|
-
import { EditBackButton } from '../components/EditBackButton';
|
|
5
|
-
describe('EditBackButton', () => {
|
|
6
|
-
it('renders with default label', () => {
|
|
7
|
-
const { getByText } = render(_jsx(EditBackButton, { onClick: () => { } }));
|
|
8
|
-
expect(getByText('← List')).toBeTruthy();
|
|
9
|
-
});
|
|
10
|
-
it('calls onClick when clicked', () => {
|
|
11
|
-
const onClick = vi.fn();
|
|
12
|
-
const { getByRole } = render(_jsx(EditBackButton, { onClick: onClick }));
|
|
13
|
-
fireEvent.click(getByRole('button'));
|
|
14
|
-
expect(onClick).toHaveBeenCalledOnce();
|
|
15
|
-
});
|
|
16
|
-
it('accepts a custom label', () => {
|
|
17
|
-
const { getByText } = render(_jsx(EditBackButton, { onClick: () => { }, label: "Go Back" }));
|
|
18
|
-
expect(getByText('Go Back')).toBeTruthy();
|
|
19
|
-
});
|
|
20
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditorBody.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditorBody.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import { EditorBody } from '../components/EditorBody';
|
|
5
|
-
describe('EditorBody', () => {
|
|
6
|
-
it('renders children in a scrollable body wrapper', () => {
|
|
7
|
-
const { getByText, container } = render(_jsx(EditorBody, { children: _jsx("p", { children: "body content" }) }));
|
|
8
|
-
expect(getByText('body content')).toBeTruthy();
|
|
9
|
-
const wrapper = container.firstElementChild;
|
|
10
|
-
expect(wrapper.className).toContain('se-overflow-auto');
|
|
11
|
-
});
|
|
12
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditorCard.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditorCard.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { fireEvent, render } from '@testing-library/react';
|
|
3
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
4
|
-
import { EditorCard } from '../components/EditorCard';
|
|
5
|
-
describe('EditorCard', () => {
|
|
6
|
-
it('renders children', () => {
|
|
7
|
-
const { getByText } = render(_jsx(EditorCard, { itemKey: "k1", children: "Card content" }));
|
|
8
|
-
expect(getByText('Card content')).toBeTruthy();
|
|
9
|
-
});
|
|
10
|
-
it('sets data-item-key attribute', () => {
|
|
11
|
-
const { container } = render(_jsx(EditorCard, { itemKey: "my-key", children: "child" }));
|
|
12
|
-
const card = container.firstElementChild;
|
|
13
|
-
expect(card.getAttribute('data-item-key')).toBe('my-key');
|
|
14
|
-
});
|
|
15
|
-
it('applies green border class when validated is true', () => {
|
|
16
|
-
const { container } = render(_jsx(EditorCard, { itemKey: "k", validated: true, children: "child" }));
|
|
17
|
-
const card = container.firstElementChild;
|
|
18
|
-
expect(card.className).toContain('se-border-green-4/50');
|
|
19
|
-
});
|
|
20
|
-
it('applies default border class when validated is false', () => {
|
|
21
|
-
const { container } = render(_jsx(EditorCard, { itemKey: "k", validated: false, children: "child" }));
|
|
22
|
-
const card = container.firstElementChild;
|
|
23
|
-
expect(card.className).toContain('se-border-border-primary');
|
|
24
|
-
});
|
|
25
|
-
it('calls onClick when Enter key is pressed', () => {
|
|
26
|
-
const onClick = vi.fn();
|
|
27
|
-
const { container } = render(_jsx(EditorCard, { itemKey: "k", onClick: onClick, children: "child" }));
|
|
28
|
-
const card = container.firstElementChild;
|
|
29
|
-
fireEvent.keyDown(card, { key: 'Enter' });
|
|
30
|
-
expect(onClick).toHaveBeenCalledTimes(1);
|
|
31
|
-
});
|
|
32
|
-
it('calls onClick when Space key is pressed', () => {
|
|
33
|
-
const onClick = vi.fn();
|
|
34
|
-
const { container } = render(_jsx(EditorCard, { itemKey: "k", onClick: onClick, children: "child" }));
|
|
35
|
-
const card = container.firstElementChild;
|
|
36
|
-
fireEvent.keyDown(card, { key: ' ' });
|
|
37
|
-
expect(onClick).toHaveBeenCalledTimes(1);
|
|
38
|
-
});
|
|
39
|
-
it('does not call onClick on other key presses', () => {
|
|
40
|
-
const onClick = vi.fn();
|
|
41
|
-
const { container } = render(_jsx(EditorCard, { itemKey: "k", onClick: onClick, children: "child" }));
|
|
42
|
-
const card = container.firstElementChild;
|
|
43
|
-
fireEvent.keyDown(card, { key: 'Tab' });
|
|
44
|
-
expect(onClick).not.toHaveBeenCalled();
|
|
45
|
-
});
|
|
46
|
-
it('has role="button" and tabIndex when onClick is provided', () => {
|
|
47
|
-
const { container } = render(_jsx(EditorCard, { itemKey: "k", onClick: () => { }, children: "child" }));
|
|
48
|
-
const card = container.firstElementChild;
|
|
49
|
-
expect(card.getAttribute('role')).toBe('button');
|
|
50
|
-
expect(card.getAttribute('tabindex')).toBe('0');
|
|
51
|
-
});
|
|
52
|
-
it('does not have role or tabIndex when onClick is not provided', () => {
|
|
53
|
-
const { container } = render(_jsx(EditorCard, { itemKey: "k", children: "child" }));
|
|
54
|
-
const card = container.firstElementChild;
|
|
55
|
-
expect(card.getAttribute('role')).toBeNull();
|
|
56
|
-
expect(card.getAttribute('tabindex')).toBeNull();
|
|
57
|
-
});
|
|
58
|
-
it('applies cursor-pointer and hover classes when onClick is provided', () => {
|
|
59
|
-
const { container } = render(_jsx(EditorCard, { itemKey: "k", onClick: () => { }, children: "child" }));
|
|
60
|
-
const card = container.firstElementChild;
|
|
61
|
-
expect(card.className).toContain('se-cursor-pointer');
|
|
62
|
-
expect(card.className).toContain('hover:se-bg-sidebar-hover');
|
|
63
|
-
});
|
|
64
|
-
it('does not apply cursor-pointer when onClick is not provided', () => {
|
|
65
|
-
const { container } = render(_jsx(EditorCard, { itemKey: "k", children: "child" }));
|
|
66
|
-
const card = container.firstElementChild;
|
|
67
|
-
expect(card.className).not.toContain('se-cursor-pointer');
|
|
68
|
-
});
|
|
69
|
-
it('calls onMouseEnter and onMouseLeave', () => {
|
|
70
|
-
const onMouseEnter = vi.fn();
|
|
71
|
-
const onMouseLeave = vi.fn();
|
|
72
|
-
const { container } = render(_jsx(EditorCard, { itemKey: "k", onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: "child" }));
|
|
73
|
-
const card = container.firstElementChild;
|
|
74
|
-
fireEvent.mouseEnter(card);
|
|
75
|
-
expect(onMouseEnter).toHaveBeenCalledTimes(1);
|
|
76
|
-
fireEvent.mouseLeave(card);
|
|
77
|
-
expect(onMouseLeave).toHaveBeenCalledTimes(1);
|
|
78
|
-
});
|
|
79
|
-
it('merges custom className', () => {
|
|
80
|
-
const { container } = render(_jsx(EditorCard, { itemKey: "k", className: "custom-class", children: "child" }));
|
|
81
|
-
const card = container.firstElementChild;
|
|
82
|
-
expect(card.className).toContain('custom-class');
|
|
83
|
-
});
|
|
84
|
-
});
|
package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorFooter.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditorFooter.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditorFooter.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { fireEvent, render } from '@testing-library/react';
|
|
3
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
4
|
-
import { EditorFooter } from '../components/EditorFooter';
|
|
5
|
-
describe('EditorFooter', () => {
|
|
6
|
-
it('renders Save Draft and Publish buttons', () => {
|
|
7
|
-
const { getByText } = render(_jsx(EditorFooter, { onSave: () => { }, onPublish: () => { } }));
|
|
8
|
-
expect(getByText('Save Draft')).toBeTruthy();
|
|
9
|
-
expect(getByText('Publish')).toBeTruthy();
|
|
10
|
-
});
|
|
11
|
-
it('calls onSave when Save Draft is clicked', () => {
|
|
12
|
-
const onSave = vi.fn();
|
|
13
|
-
const { getByText } = render(_jsx(EditorFooter, { onSave: onSave, onPublish: () => { } }));
|
|
14
|
-
fireEvent.click(getByText('Save Draft'));
|
|
15
|
-
expect(onSave).toHaveBeenCalledOnce();
|
|
16
|
-
});
|
|
17
|
-
it('calls onPublish when Publish is clicked', () => {
|
|
18
|
-
const onPublish = vi.fn();
|
|
19
|
-
const { getByText } = render(_jsx(EditorFooter, { onSave: () => { }, onPublish: onPublish }));
|
|
20
|
-
fireEvent.click(getByText('Publish'));
|
|
21
|
-
expect(onPublish).toHaveBeenCalledOnce();
|
|
22
|
-
});
|
|
23
|
-
});
|
package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorHeader.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditorHeader.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditorHeader.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
4
|
-
import { EditorHeader } from '../components/EditorHeader';
|
|
5
|
-
describe('EditorHeader', () => {
|
|
6
|
-
it('renders title', () => {
|
|
7
|
-
const { getByText } = render(_jsx(EditorHeader, { title: "My Title", onBack: () => { } }));
|
|
8
|
-
expect(getByText('My Title')).toBeTruthy();
|
|
9
|
-
});
|
|
10
|
-
it('renders optional subtitle', () => {
|
|
11
|
-
const { getByText } = render(_jsx(EditorHeader, { title: "T", subtitle: "Sub", onBack: () => { } }));
|
|
12
|
-
expect(getByText('Sub')).toBeTruthy();
|
|
13
|
-
});
|
|
14
|
-
it('does not render subtitle when not provided', () => {
|
|
15
|
-
const { queryByText } = render(_jsx(EditorHeader, { title: "T", onBack: () => { } }));
|
|
16
|
-
expect(queryByText('Sub')).toBeNull();
|
|
17
|
-
});
|
|
18
|
-
it('accepts deprecated onBack prop without rendering a back button', () => {
|
|
19
|
-
const onBack = vi.fn();
|
|
20
|
-
const { queryByText } = render(_jsx(EditorHeader, { title: "T", onBack: onBack }));
|
|
21
|
-
expect(queryByText('← Back')).toBeNull();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditorInput.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditorInput.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import { EditorInput } from '../components/EditorInput';
|
|
5
|
-
describe('EditorInput', () => {
|
|
6
|
-
it('renders label when provided', () => {
|
|
7
|
-
const { getByText } = render(_jsx(EditorInput, { label: "Name" }));
|
|
8
|
-
expect(getByText('Name')).toBeTruthy();
|
|
9
|
-
});
|
|
10
|
-
it('renders an input element', () => {
|
|
11
|
-
const { container } = render(_jsx(EditorInput, {}));
|
|
12
|
-
expect(container.querySelector('input')).toBeTruthy();
|
|
13
|
-
});
|
|
14
|
-
it('spreads HTML attributes onto the input', () => {
|
|
15
|
-
const { container } = render(_jsx(EditorInput, { placeholder: "type here", disabled: true }));
|
|
16
|
-
const input = container.querySelector('input');
|
|
17
|
-
expect(input.placeholder).toBe('type here');
|
|
18
|
-
expect(input.disabled).toBe(true);
|
|
19
|
-
});
|
|
20
|
-
it('merges custom className', () => {
|
|
21
|
-
const { container } = render(_jsx(EditorInput, { className: "custom" }));
|
|
22
|
-
const input = container.querySelector('input');
|
|
23
|
-
expect(input.className).toContain('custom');
|
|
24
|
-
expect(input.className).toContain('se-w-full');
|
|
25
|
-
});
|
|
26
|
-
});
|
package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorLayout.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditorLayout.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditorLayout.test.tsx"],"names":[],"mappings":""}
|