@actuate-media/cms-admin 0.12.0 → 0.13.0
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/dist/__tests__/components/comment-mark.test.d.ts +2 -0
- package/dist/__tests__/components/comment-mark.test.d.ts.map +1 -0
- package/dist/__tests__/components/comment-mark.test.js +89 -0
- package/dist/__tests__/components/comment-mark.test.js.map +1 -0
- package/dist/__tests__/components/comment-side-panel.test.d.ts +2 -0
- package/dist/__tests__/components/comment-side-panel.test.d.ts.map +1 -0
- package/dist/__tests__/components/comment-side-panel.test.js +291 -0
- package/dist/__tests__/components/comment-side-panel.test.js.map +1 -0
- package/dist/__tests__/components/notification-bell.test.d.ts +2 -0
- package/dist/__tests__/components/notification-bell.test.d.ts.map +1 -0
- package/dist/__tests__/components/notification-bell.test.js +346 -0
- package/dist/__tests__/components/notification-bell.test.js.map +1 -0
- package/dist/__tests__/components/offline-status.test.d.ts +2 -0
- package/dist/__tests__/components/offline-status.test.d.ts.map +1 -0
- package/dist/__tests__/components/offline-status.test.js +56 -0
- package/dist/__tests__/components/offline-status.test.js.map +1 -0
- package/dist/__tests__/components/presence-chips-helpers.test.d.ts +2 -0
- package/dist/__tests__/components/presence-chips-helpers.test.d.ts.map +1 -0
- package/dist/__tests__/components/presence-chips-helpers.test.js +35 -0
- package/dist/__tests__/components/presence-chips-helpers.test.js.map +1 -0
- package/dist/__tests__/lib/active-editor.test.d.ts +2 -0
- package/dist/__tests__/lib/active-editor.test.d.ts.map +1 -0
- package/dist/__tests__/lib/active-editor.test.js +57 -0
- package/dist/__tests__/lib/active-editor.test.js.map +1 -0
- package/dist/__tests__/lib/coauthor-client.test.d.ts +2 -0
- package/dist/__tests__/lib/coauthor-client.test.d.ts.map +1 -0
- package/dist/__tests__/lib/coauthor-client.test.js +173 -0
- package/dist/__tests__/lib/coauthor-client.test.js.map +1 -0
- package/dist/__tests__/lib/collaboration-provider.test.d.ts +2 -0
- package/dist/__tests__/lib/collaboration-provider.test.d.ts.map +1 -0
- package/dist/__tests__/lib/collaboration-provider.test.js +335 -0
- package/dist/__tests__/lib/collaboration-provider.test.js.map +1 -0
- package/dist/__tests__/lib/comment-anchor.test.d.ts +2 -0
- package/dist/__tests__/lib/comment-anchor.test.d.ts.map +1 -0
- package/dist/__tests__/lib/comment-anchor.test.js +173 -0
- package/dist/__tests__/lib/comment-anchor.test.js.map +1 -0
- package/dist/__tests__/lib/comments-client.test.d.ts +2 -0
- package/dist/__tests__/lib/comments-client.test.d.ts.map +1 -0
- package/dist/__tests__/lib/comments-client.test.js +202 -0
- package/dist/__tests__/lib/comments-client.test.js.map +1 -0
- package/dist/__tests__/lib/notifications-client.test.d.ts +2 -0
- package/dist/__tests__/lib/notifications-client.test.d.ts.map +1 -0
- package/dist/__tests__/lib/notifications-client.test.js +283 -0
- package/dist/__tests__/lib/notifications-client.test.js.map +1 -0
- package/dist/__tests__/lib/slash-command.test.d.ts +2 -0
- package/dist/__tests__/lib/slash-command.test.d.ts.map +1 -0
- package/dist/__tests__/lib/slash-command.test.js +123 -0
- package/dist/__tests__/lib/slash-command.test.js.map +1 -0
- package/dist/actuate-admin.css +1 -1
- package/dist/components/AICoauthorBubbleMenu.d.ts +18 -0
- package/dist/components/AICoauthorBubbleMenu.d.ts.map +1 -0
- package/dist/components/AICoauthorBubbleMenu.js +113 -0
- package/dist/components/AICoauthorBubbleMenu.js.map +1 -0
- package/dist/components/CoauthorResultPopover.d.ts +28 -0
- package/dist/components/CoauthorResultPopover.d.ts.map +1 -0
- package/dist/components/CoauthorResultPopover.js +42 -0
- package/dist/components/CoauthorResultPopover.js.map +1 -0
- package/dist/components/CommandPalette.d.ts +1 -1
- package/dist/components/CommandPalette.d.ts.map +1 -1
- package/dist/components/CommandPalette.js +138 -40
- package/dist/components/CommandPalette.js.map +1 -1
- package/dist/components/CommentMark.d.ts +54 -0
- package/dist/components/CommentMark.d.ts.map +1 -0
- package/dist/components/CommentMark.js +104 -0
- package/dist/components/CommentMark.js.map +1 -0
- package/dist/components/CommentSidePanel.d.ts +86 -0
- package/dist/components/CommentSidePanel.d.ts.map +1 -0
- package/dist/components/CommentSidePanel.js +165 -0
- package/dist/components/CommentSidePanel.js.map +1 -0
- package/dist/components/LivePreview.d.ts.map +1 -1
- package/dist/components/LivePreview.js +80 -16
- package/dist/components/LivePreview.js.map +1 -1
- package/dist/components/NotificationBell.d.ts +66 -0
- package/dist/components/NotificationBell.d.ts.map +1 -0
- package/dist/components/NotificationBell.js +142 -0
- package/dist/components/NotificationBell.js.map +1 -0
- package/dist/components/OfflineStatus.d.ts +39 -0
- package/dist/components/OfflineStatus.d.ts.map +1 -0
- package/dist/components/OfflineStatus.js +47 -0
- package/dist/components/OfflineStatus.js.map +1 -0
- package/dist/components/PresenceChips.d.ts +31 -0
- package/dist/components/PresenceChips.d.ts.map +1 -0
- package/dist/components/PresenceChips.js +58 -0
- package/dist/components/PresenceChips.js.map +1 -0
- package/dist/components/TipTapEditor.d.ts +61 -1
- package/dist/components/TipTapEditor.d.ts.map +1 -1
- package/dist/components/TipTapEditor.js +211 -8
- package/dist/components/TipTapEditor.js.map +1 -1
- package/dist/components/ui/Badge.d.ts +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/active-editor.d.ts +6 -0
- package/dist/lib/active-editor.d.ts.map +1 -0
- package/dist/lib/active-editor.js +35 -0
- package/dist/lib/active-editor.js.map +1 -0
- package/dist/lib/api.d.ts +8 -0
- package/dist/lib/api.d.ts.map +1 -1
- package/dist/lib/api.js +10 -0
- package/dist/lib/api.js.map +1 -1
- package/dist/lib/coauthor-client.d.ts +72 -0
- package/dist/lib/coauthor-client.d.ts.map +1 -0
- package/dist/lib/coauthor-client.js +98 -0
- package/dist/lib/coauthor-client.js.map +1 -0
- package/dist/lib/collaboration-provider.d.ts +142 -0
- package/dist/lib/collaboration-provider.d.ts.map +1 -0
- package/dist/lib/collaboration-provider.js +168 -0
- package/dist/lib/collaboration-provider.js.map +1 -0
- package/dist/lib/comment-anchor.d.ts +86 -0
- package/dist/lib/comment-anchor.d.ts.map +1 -0
- package/dist/lib/comment-anchor.js +139 -0
- package/dist/lib/comment-anchor.js.map +1 -0
- package/dist/lib/comments-client.d.ts +106 -0
- package/dist/lib/comments-client.d.ts.map +1 -0
- package/dist/lib/comments-client.js +138 -0
- package/dist/lib/comments-client.js.map +1 -0
- package/dist/lib/notifications-client.d.ts +121 -0
- package/dist/lib/notifications-client.d.ts.map +1 -0
- package/dist/lib/notifications-client.js +173 -0
- package/dist/lib/notifications-client.js.map +1 -0
- package/dist/lib/slash-command.d.ts +39 -0
- package/dist/lib/slash-command.d.ts.map +1 -0
- package/dist/lib/slash-command.js +50 -0
- package/dist/lib/slash-command.js.map +1 -0
- package/package.json +12 -3
- package/src/__tests__/components/comment-mark.test.ts +99 -0
- package/src/__tests__/components/comment-side-panel.test.tsx +343 -0
- package/src/__tests__/components/notification-bell.test.tsx +379 -0
- package/src/__tests__/components/offline-status.test.tsx +66 -0
- package/src/__tests__/components/presence-chips-helpers.test.ts +44 -0
- package/src/__tests__/lib/active-editor.test.ts +70 -0
- package/src/__tests__/lib/coauthor-client.test.ts +213 -0
- package/src/__tests__/lib/collaboration-provider.test.ts +425 -0
- package/src/__tests__/lib/comment-anchor.test.ts +188 -0
- package/src/__tests__/lib/comments-client.test.ts +239 -0
- package/src/__tests__/lib/notifications-client.test.ts +339 -0
- package/src/__tests__/lib/slash-command.test.ts +146 -0
- package/src/components/AICoauthorBubbleMenu.tsx +187 -0
- package/src/components/CoauthorResultPopover.tsx +193 -0
- package/src/components/CommandPalette.tsx +397 -209
- package/src/components/CommentMark.ts +138 -0
- package/src/components/CommentSidePanel.tsx +521 -0
- package/src/components/LivePreview.tsx +117 -11
- package/src/components/NotificationBell.tsx +314 -0
- package/src/components/OfflineStatus.tsx +90 -0
- package/src/components/PresenceChips.tsx +150 -0
- package/src/components/TipTapEditor.tsx +310 -12
- package/src/index.ts +20 -0
- package/src/lib/active-editor.ts +39 -0
- package/src/lib/api.ts +11 -0
- package/src/lib/coauthor-client.ts +160 -0
- package/src/lib/collaboration-provider.ts +306 -0
- package/src/lib/comment-anchor.ts +179 -0
- package/src/lib/comments-client.ts +208 -0
- package/src/lib/notifications-client.ts +292 -0
- package/src/lib/slash-command.ts +67 -0
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// @vitest-environment happy-dom
|
|
3
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
4
|
+
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';
|
|
5
|
+
import { NotificationBell } from '../../components/NotificationBell.js';
|
|
6
|
+
function ok(value) {
|
|
7
|
+
return { ok: true, result: value };
|
|
8
|
+
}
|
|
9
|
+
function err(error = 'boom', status = 500) {
|
|
10
|
+
return { ok: false, error, status };
|
|
11
|
+
}
|
|
12
|
+
function row(overrides = {}) {
|
|
13
|
+
return {
|
|
14
|
+
id: 'n-1',
|
|
15
|
+
userId: 'user-1',
|
|
16
|
+
kind: 'comment_reply',
|
|
17
|
+
documentId: 'doc-1',
|
|
18
|
+
commentId: 'c-1',
|
|
19
|
+
payload: {
|
|
20
|
+
kind: 'comment_reply',
|
|
21
|
+
actorId: 'someone',
|
|
22
|
+
actorName: 'Someone',
|
|
23
|
+
excerpt: 'hi',
|
|
24
|
+
},
|
|
25
|
+
readAt: null,
|
|
26
|
+
createdAt: '2026-01-01T00:00:00.000Z',
|
|
27
|
+
...overrides,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function createFakeApi() {
|
|
31
|
+
let rows = [];
|
|
32
|
+
const calls = [];
|
|
33
|
+
const api = {
|
|
34
|
+
list: vi.fn(async (opts) => {
|
|
35
|
+
calls.push({ name: 'list', args: [opts] });
|
|
36
|
+
return ok(opts.includeRead ? rows : rows.filter((r) => r.readAt === null));
|
|
37
|
+
}),
|
|
38
|
+
unread: vi.fn(async () => {
|
|
39
|
+
calls.push({ name: 'unread', args: [] });
|
|
40
|
+
return ok(rows.filter((r) => r.readAt === null).length);
|
|
41
|
+
}),
|
|
42
|
+
markRead: vi.fn(async (id) => {
|
|
43
|
+
calls.push({ name: 'markRead', args: [id] });
|
|
44
|
+
const target = rows.find((r) => r.id === id);
|
|
45
|
+
if (!target)
|
|
46
|
+
return err('not found', 404);
|
|
47
|
+
target.readAt = '2026-01-02T00:00:00.000Z';
|
|
48
|
+
return ok(target);
|
|
49
|
+
}),
|
|
50
|
+
markAllRead: vi.fn(async () => {
|
|
51
|
+
calls.push({ name: 'markAllRead', args: [] });
|
|
52
|
+
let n = 0;
|
|
53
|
+
for (const r of rows) {
|
|
54
|
+
if (r.readAt === null) {
|
|
55
|
+
r.readAt = '2026-01-02T00:00:00.000Z';
|
|
56
|
+
n++;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return ok(n);
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
api,
|
|
64
|
+
calls,
|
|
65
|
+
setRows: (next) => {
|
|
66
|
+
rows = next;
|
|
67
|
+
},
|
|
68
|
+
rows: () => rows,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
describe('NotificationBell — badge', () => {
|
|
72
|
+
it('shows the unread badge from the unread() call', async () => {
|
|
73
|
+
const fake = createFakeApi();
|
|
74
|
+
fake.setRows([row(), row({ id: 'n-2' })]);
|
|
75
|
+
render(_jsx(NotificationBell, { api: fake.api, pollIntervalMs: 0 }));
|
|
76
|
+
await waitFor(() => expect(screen.getByTestId('bell-badge').textContent).toBe('2'));
|
|
77
|
+
});
|
|
78
|
+
it('hides the badge when count is 0', async () => {
|
|
79
|
+
const fake = createFakeApi();
|
|
80
|
+
render(_jsx(NotificationBell, { api: fake.api, pollIntervalMs: 0 }));
|
|
81
|
+
// Let the initial unread() settle.
|
|
82
|
+
await waitFor(() => expect(fake.api.unread).toHaveBeenCalled());
|
|
83
|
+
expect(screen.queryByTestId('bell-badge')).toBeNull();
|
|
84
|
+
});
|
|
85
|
+
it('clamps the badge at "99+"', async () => {
|
|
86
|
+
const fake = createFakeApi();
|
|
87
|
+
fake.setRows(Array.from({ length: 150 }, (_, i) => row({ id: `n-${i}` })));
|
|
88
|
+
render(_jsx(NotificationBell, { api: fake.api, pollIntervalMs: 0 }));
|
|
89
|
+
await waitFor(() => expect(screen.getByTestId('bell-badge').textContent).toBe('99+'));
|
|
90
|
+
});
|
|
91
|
+
it('polls unread() at pollIntervalMs', async () => {
|
|
92
|
+
vi.useFakeTimers({ shouldAdvanceTime: true });
|
|
93
|
+
try {
|
|
94
|
+
const fake = createFakeApi();
|
|
95
|
+
render(_jsx(NotificationBell, { api: fake.api, pollIntervalMs: 5000 }));
|
|
96
|
+
await waitFor(() => expect(fake.api.unread).toHaveBeenCalledTimes(1));
|
|
97
|
+
await act(async () => {
|
|
98
|
+
vi.advanceTimersByTime(5000);
|
|
99
|
+
});
|
|
100
|
+
expect(fake.api.unread).toHaveBeenCalledTimes(2);
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
vi.useRealTimers();
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
describe('NotificationBell — dropdown', () => {
|
|
108
|
+
it('shows the empty state when there are no rows', async () => {
|
|
109
|
+
const fake = createFakeApi();
|
|
110
|
+
render(_jsx(NotificationBell, { api: fake.api, pollIntervalMs: 0 }));
|
|
111
|
+
await waitFor(() => expect(fake.api.unread).toHaveBeenCalled());
|
|
112
|
+
fireEvent.click(screen.getByTestId('bell-button'));
|
|
113
|
+
await waitFor(() => expect(screen.getByTestId('bell-dropdown')).toBeTruthy());
|
|
114
|
+
await waitFor(() => expect(screen.getByText('All caught up.')).toBeTruthy());
|
|
115
|
+
});
|
|
116
|
+
it('renders one button per row with the formatted summary', async () => {
|
|
117
|
+
const fake = createFakeApi();
|
|
118
|
+
fake.setRows([
|
|
119
|
+
row({
|
|
120
|
+
id: 'n-a',
|
|
121
|
+
payload: {
|
|
122
|
+
kind: 'comment_reply',
|
|
123
|
+
actorId: 'x',
|
|
124
|
+
actorName: 'Alice',
|
|
125
|
+
excerpt: 'good',
|
|
126
|
+
},
|
|
127
|
+
}),
|
|
128
|
+
row({
|
|
129
|
+
id: 'n-b',
|
|
130
|
+
kind: 'comment_resolved',
|
|
131
|
+
payload: {
|
|
132
|
+
kind: 'comment_resolved',
|
|
133
|
+
actorId: 'y',
|
|
134
|
+
actorName: 'Bob',
|
|
135
|
+
rootExcerpt: 'fix',
|
|
136
|
+
},
|
|
137
|
+
}),
|
|
138
|
+
]);
|
|
139
|
+
render(_jsx(NotificationBell, { api: fake.api, pollIntervalMs: 0 }));
|
|
140
|
+
await waitFor(() => expect(fake.api.unread).toHaveBeenCalled());
|
|
141
|
+
fireEvent.click(screen.getByTestId('bell-button'));
|
|
142
|
+
await waitFor(() => expect(screen.getByTestId('bell-row-n-a')).toBeTruthy());
|
|
143
|
+
expect(screen.getByTestId('bell-row-n-a').textContent).toContain('Alice replied');
|
|
144
|
+
expect(screen.getByTestId('bell-row-n-b').textContent).toContain('Bob resolved');
|
|
145
|
+
});
|
|
146
|
+
it('marks a row read optimistically, then via the API', async () => {
|
|
147
|
+
const fake = createFakeApi();
|
|
148
|
+
const onSelect = vi.fn();
|
|
149
|
+
fake.setRows([row()]);
|
|
150
|
+
render(_jsx(NotificationBell, { api: fake.api, pollIntervalMs: 0, onSelect: onSelect }));
|
|
151
|
+
await waitFor(() => expect(screen.getByTestId('bell-badge').textContent).toBe('1'));
|
|
152
|
+
fireEvent.click(screen.getByTestId('bell-button'));
|
|
153
|
+
await waitFor(() => expect(screen.getByTestId('bell-row-n-1')).toBeTruthy());
|
|
154
|
+
await act(async () => {
|
|
155
|
+
fireEvent.click(screen.getByTestId('bell-row-n-1'));
|
|
156
|
+
});
|
|
157
|
+
expect(fake.api.markRead).toHaveBeenCalledWith('n-1');
|
|
158
|
+
expect(onSelect).toHaveBeenCalledTimes(1);
|
|
159
|
+
expect(screen.queryByTestId('bell-badge')).toBeNull();
|
|
160
|
+
});
|
|
161
|
+
it('rolls back the optimistic update when markRead fails', async () => {
|
|
162
|
+
const fake = createFakeApi();
|
|
163
|
+
fake.api.markRead.mockResolvedValueOnce(err('server', 500));
|
|
164
|
+
const onError = vi.fn();
|
|
165
|
+
fake.setRows([row()]);
|
|
166
|
+
render(_jsx(NotificationBell, { api: fake.api, pollIntervalMs: 0, onError: onError }));
|
|
167
|
+
await waitFor(() => expect(screen.getByTestId('bell-badge').textContent).toBe('1'));
|
|
168
|
+
fireEvent.click(screen.getByTestId('bell-button'));
|
|
169
|
+
await waitFor(() => expect(screen.getByTestId('bell-row-n-1')).toBeTruthy());
|
|
170
|
+
await act(async () => {
|
|
171
|
+
fireEvent.click(screen.getByTestId('bell-row-n-1'));
|
|
172
|
+
});
|
|
173
|
+
expect(onError).toHaveBeenCalledWith('server');
|
|
174
|
+
// The badge should bounce back to 1.
|
|
175
|
+
await waitFor(() => expect(screen.getByTestId('bell-badge').textContent).toBe('1'));
|
|
176
|
+
});
|
|
177
|
+
it('marks all read in one click and disables the button after', async () => {
|
|
178
|
+
const fake = createFakeApi();
|
|
179
|
+
fake.setRows([row(), row({ id: 'n-2' })]);
|
|
180
|
+
render(_jsx(NotificationBell, { api: fake.api, pollIntervalMs: 0 }));
|
|
181
|
+
await waitFor(() => expect(screen.getByTestId('bell-badge').textContent).toBe('2'));
|
|
182
|
+
fireEvent.click(screen.getByTestId('bell-button'));
|
|
183
|
+
await waitFor(() => expect(screen.getByTestId('bell-mark-all')).toBeTruthy());
|
|
184
|
+
await act(async () => {
|
|
185
|
+
fireEvent.click(screen.getByTestId('bell-mark-all'));
|
|
186
|
+
});
|
|
187
|
+
expect(fake.api.markAllRead).toHaveBeenCalled();
|
|
188
|
+
expect(screen.getByTestId('bell-mark-all').disabled).toBe(true);
|
|
189
|
+
});
|
|
190
|
+
it('surfaces list() errors via onError', async () => {
|
|
191
|
+
const fake = createFakeApi();
|
|
192
|
+
fake.api.list.mockResolvedValueOnce(err('CSRF', 403));
|
|
193
|
+
const onError = vi.fn();
|
|
194
|
+
render(_jsx(NotificationBell, { api: fake.api, pollIntervalMs: 0, onError: onError }));
|
|
195
|
+
await waitFor(() => expect(fake.api.unread).toHaveBeenCalled());
|
|
196
|
+
fireEvent.click(screen.getByTestId('bell-button'));
|
|
197
|
+
await waitFor(() => expect(onError).toHaveBeenCalledWith('CSRF'));
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
// ---------------------------------------------------------------------------
|
|
201
|
+
// SSE push channel (Phase 7) — verify the bell wires up subscribe(),
|
|
202
|
+
// processes incoming notifications, and tears down on unmount.
|
|
203
|
+
// ---------------------------------------------------------------------------
|
|
204
|
+
describe('NotificationBell — SSE push', () => {
|
|
205
|
+
function withSubscribe(api) {
|
|
206
|
+
let captured;
|
|
207
|
+
let closed = false;
|
|
208
|
+
const handle = {
|
|
209
|
+
close: () => {
|
|
210
|
+
closed = true;
|
|
211
|
+
},
|
|
212
|
+
};
|
|
213
|
+
const subscribe = vi.fn((opts) => {
|
|
214
|
+
captured = opts;
|
|
215
|
+
return handle;
|
|
216
|
+
});
|
|
217
|
+
return {
|
|
218
|
+
api: { ...api, subscribe },
|
|
219
|
+
push: (n) => captured?.onNotification(n),
|
|
220
|
+
pushError: (e) => captured?.onError?.(e),
|
|
221
|
+
isClosed: () => closed,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
it('subscribes on mount and bumps the badge when a new notification arrives', async () => {
|
|
225
|
+
const fake = createFakeApi();
|
|
226
|
+
const wired = withSubscribe(fake.api);
|
|
227
|
+
render(_jsx(NotificationBell, { api: wired.api, pollIntervalMs: 0 }));
|
|
228
|
+
await waitFor(() => expect(fake.api.unread).toHaveBeenCalled());
|
|
229
|
+
await act(async () => {
|
|
230
|
+
wired.push(row({ id: 'sse-1' }));
|
|
231
|
+
});
|
|
232
|
+
await waitFor(() => expect(screen.getByTestId('bell-badge').textContent).toBe('1'));
|
|
233
|
+
});
|
|
234
|
+
it('does not double-count a notification that arrives via both SSE and REST', async () => {
|
|
235
|
+
const fake = createFakeApi();
|
|
236
|
+
const wired = withSubscribe(fake.api);
|
|
237
|
+
fake.setRows([row({ id: 'race' })]);
|
|
238
|
+
render(_jsx(NotificationBell, { api: wired.api, pollIntervalMs: 0 }));
|
|
239
|
+
// Open the dropdown so the row is in `items` from the REST list.
|
|
240
|
+
await waitFor(() => expect(screen.getByTestId('bell-badge').textContent).toBe('1'));
|
|
241
|
+
fireEvent.click(screen.getByTestId('bell-button'));
|
|
242
|
+
await waitFor(() => expect(screen.getByTestId('bell-row-race')).toBeTruthy());
|
|
243
|
+
// Now push the same row via SSE — must NOT add a duplicate or
|
|
244
|
+
// bump the badge above 1.
|
|
245
|
+
await act(async () => {
|
|
246
|
+
wired.push(row({ id: 'race' }));
|
|
247
|
+
});
|
|
248
|
+
expect(screen.getAllByTestId('bell-row-race')).toHaveLength(1);
|
|
249
|
+
expect(screen.getByTestId('bell-badge').textContent).toBe('1');
|
|
250
|
+
});
|
|
251
|
+
it('prepends new pushed rows to the open dropdown', async () => {
|
|
252
|
+
const fake = createFakeApi();
|
|
253
|
+
const wired = withSubscribe(fake.api);
|
|
254
|
+
fake.setRows([row({ id: 'old' })]);
|
|
255
|
+
render(_jsx(NotificationBell, { api: wired.api, pollIntervalMs: 0 }));
|
|
256
|
+
await waitFor(() => expect(screen.getByTestId('bell-badge').textContent).toBe('1'));
|
|
257
|
+
fireEvent.click(screen.getByTestId('bell-button'));
|
|
258
|
+
await waitFor(() => expect(screen.getByTestId('bell-row-old')).toBeTruthy());
|
|
259
|
+
await act(async () => {
|
|
260
|
+
wired.push(row({ id: 'fresh' }));
|
|
261
|
+
});
|
|
262
|
+
const rows = screen.getAllByTestId(/^bell-row-/);
|
|
263
|
+
expect(rows[0].getAttribute('data-testid')).toBe('bell-row-fresh');
|
|
264
|
+
});
|
|
265
|
+
it('does NOT bump the badge when the pushed notification is already read', async () => {
|
|
266
|
+
const fake = createFakeApi();
|
|
267
|
+
const wired = withSubscribe(fake.api);
|
|
268
|
+
render(_jsx(NotificationBell, { api: wired.api, pollIntervalMs: 0 }));
|
|
269
|
+
await waitFor(() => expect(fake.api.unread).toHaveBeenCalled());
|
|
270
|
+
await act(async () => {
|
|
271
|
+
wired.push(row({ id: 'already-read', readAt: '2026-01-02T00:00:00.000Z' }));
|
|
272
|
+
});
|
|
273
|
+
// Already-read notifications still appear in the list when the
|
|
274
|
+
// user opens the dropdown with includeRead=true, but they must
|
|
275
|
+
// NOT register a fresh unread bump.
|
|
276
|
+
expect(screen.queryByTestId('bell-badge')).toBeNull();
|
|
277
|
+
});
|
|
278
|
+
it('closes the SSE subscription when the bell unmounts', async () => {
|
|
279
|
+
const fake = createFakeApi();
|
|
280
|
+
const wired = withSubscribe(fake.api);
|
|
281
|
+
const { unmount } = render(_jsx(NotificationBell, { api: wired.api, pollIntervalMs: 0 }));
|
|
282
|
+
await waitFor(() => expect(fake.api.unread).toHaveBeenCalled());
|
|
283
|
+
unmount();
|
|
284
|
+
expect(wired.isClosed()).toBe(true);
|
|
285
|
+
});
|
|
286
|
+
it('does not surface transient SSE errors via onError (poll loop handles convergence)', async () => {
|
|
287
|
+
const fake = createFakeApi();
|
|
288
|
+
const wired = withSubscribe(fake.api);
|
|
289
|
+
const onError = vi.fn();
|
|
290
|
+
render(_jsx(NotificationBell, { api: wired.api, pollIntervalMs: 0, onError: onError }));
|
|
291
|
+
await waitFor(() => expect(fake.api.unread).toHaveBeenCalled());
|
|
292
|
+
await act(async () => {
|
|
293
|
+
wired.pushError(new Event('error'));
|
|
294
|
+
});
|
|
295
|
+
// Deliberately quiet — see NotificationBell SSE handler comment.
|
|
296
|
+
expect(onError).not.toHaveBeenCalled();
|
|
297
|
+
});
|
|
298
|
+
it('mark-all-read failure does not drop SSE rows that arrived mid-flight', async () => {
|
|
299
|
+
const fake = createFakeApi();
|
|
300
|
+
const wired = withSubscribe(fake.api);
|
|
301
|
+
fake.setRows([row({ id: 'before' })]);
|
|
302
|
+
// Hold the markAllRead promise so we can interleave an SSE push.
|
|
303
|
+
let resolveMark = () => undefined;
|
|
304
|
+
wired.api.markAllRead.mockImplementationOnce(() => new Promise((resolve) => {
|
|
305
|
+
resolveMark = resolve;
|
|
306
|
+
}));
|
|
307
|
+
const onError = vi.fn();
|
|
308
|
+
render(_jsx(NotificationBell, { api: wired.api, pollIntervalMs: 0, onError: onError }));
|
|
309
|
+
await waitFor(() => expect(screen.getByTestId('bell-badge').textContent).toBe('1'));
|
|
310
|
+
fireEvent.click(screen.getByTestId('bell-button'));
|
|
311
|
+
await waitFor(() => expect(screen.getByTestId('bell-row-before')).toBeTruthy());
|
|
312
|
+
// Click mark-all — handler optimistically marks 'before' read,
|
|
313
|
+
// but the API promise is still pending.
|
|
314
|
+
await act(async () => {
|
|
315
|
+
fireEvent.click(screen.getByTestId('bell-mark-all'));
|
|
316
|
+
});
|
|
317
|
+
// While in flight, a fresh notification arrives via SSE.
|
|
318
|
+
await act(async () => {
|
|
319
|
+
wired.push(row({ id: 'mid-flight' }));
|
|
320
|
+
});
|
|
321
|
+
// Now resolve the API with a failure.
|
|
322
|
+
await act(async () => {
|
|
323
|
+
resolveMark({ ok: false, error: 'server', status: 500 });
|
|
324
|
+
// flush promise chain
|
|
325
|
+
await Promise.resolve();
|
|
326
|
+
});
|
|
327
|
+
expect(onError).toHaveBeenCalledWith('server');
|
|
328
|
+
// The original row was rolled back to unread...
|
|
329
|
+
expect(screen.getByTestId('bell-row-before').getAttribute('data-read')).toBe('false');
|
|
330
|
+
// ...and the SSE arrival is still present (not dropped by the
|
|
331
|
+
// legacy snapshot-replace rollback).
|
|
332
|
+
expect(screen.getByTestId('bell-row-mid-flight')).toBeTruthy();
|
|
333
|
+
});
|
|
334
|
+
it('still mounts cleanly when api.subscribe is undefined (no SSE support)', async () => {
|
|
335
|
+
const fake = createFakeApi();
|
|
336
|
+
// Strip the `subscribe` member entirely — defaultApi has it,
|
|
337
|
+
// but consumer-provided test APIs may not.
|
|
338
|
+
const apiWithoutSubscribe = { ...fake.api };
|
|
339
|
+
delete apiWithoutSubscribe.subscribe;
|
|
340
|
+
render(_jsx(NotificationBell, { api: apiWithoutSubscribe, pollIntervalMs: 0 }));
|
|
341
|
+
await waitFor(() => expect(fake.api.unread).toHaveBeenCalled());
|
|
342
|
+
// No crash, badge from unread() shows nothing, no items.
|
|
343
|
+
expect(screen.queryByTestId('bell-badge')).toBeNull();
|
|
344
|
+
});
|
|
345
|
+
});
|
|
346
|
+
//# sourceMappingURL=notification-bell.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-bell.test.js","sourceRoot":"","sources":["../../../src/__tests__/components/notification-bell.test.tsx"],"names":[],"mappings":";AAAA,gCAAgC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAEjD,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAEhF,OAAO,EAAE,gBAAgB,EAAyB,MAAM,sCAAsC,CAAA;AAQ9F,SAAS,EAAE,CAAI,KAAQ;IACrB,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;AACpC,CAAC;AAED,SAAS,GAAG,CAAC,KAAK,GAAG,MAAM,EAAE,MAAM,GAAG,GAAG;IACvC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA;AACrC,CAAC;AAED,SAAS,GAAG,CAAC,YAAmC,EAAE;IAChD,OAAO;QACL,EAAE,EAAE,KAAK;QACT,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,eAAe;QACrB,UAAU,EAAE,OAAO;QACnB,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE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AAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAC7D,OAAQ,mBAA+C,CAAC,SAAS,CAAA;QACjE,MAAM,CAAC,KAAC,gBAAgB,IAAC,GAAG,EAAE,mBAAmB,EAAE,cAAc,EAAE,CAAC,GAAI,CAAC,CAAA;QACzE,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,gBAAgB,EAAE,CAAC,CAAA;QAC/D,yDAAyD;QACzD,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA;IACvD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offline-status.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/components/offline-status.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// @vitest-environment happy-dom
|
|
3
|
+
import { describe, expect, it } from 'vitest';
|
|
4
|
+
import { render, screen } from '@testing-library/react';
|
|
5
|
+
import { OfflineStatus, describeOfflineStatus } from '../../components/OfflineStatus.js';
|
|
6
|
+
describe('describeOfflineStatus', () => {
|
|
7
|
+
it('error wins over everything', () => {
|
|
8
|
+
expect(describeOfflineStatus('connected', 'error').tone).toBe('bad');
|
|
9
|
+
expect(describeOfflineStatus('disconnected', 'error').tone).toBe('bad');
|
|
10
|
+
});
|
|
11
|
+
it('reports Synced when offline is unsupported but socket is connected', () => {
|
|
12
|
+
const out = describeOfflineStatus('connected', 'unsupported');
|
|
13
|
+
expect(out.tone).toBe('good');
|
|
14
|
+
expect(out.label).toBe('Synced');
|
|
15
|
+
});
|
|
16
|
+
it('warns when offline is unsupported and socket is disconnected', () => {
|
|
17
|
+
expect(describeOfflineStatus('disconnected', 'unsupported').tone).toBe('warn');
|
|
18
|
+
});
|
|
19
|
+
it('shows Connecting… when offline is unsupported and socket is connecting', () => {
|
|
20
|
+
expect(describeOfflineStatus('connecting', 'unsupported').label).toBe('Connecting…');
|
|
21
|
+
});
|
|
22
|
+
it('reports Restoring local copy… while IndexedDB is loading', () => {
|
|
23
|
+
expect(describeOfflineStatus('connecting', 'loading').label).toMatch(/Restoring/);
|
|
24
|
+
expect(describeOfflineStatus('connecting', 'pending').label).toMatch(/Restoring/);
|
|
25
|
+
});
|
|
26
|
+
it('reports Saved & synced when both ready', () => {
|
|
27
|
+
const out = describeOfflineStatus('connected', 'ready');
|
|
28
|
+
expect(out.tone).toBe('good');
|
|
29
|
+
expect(out.label).toBe('Saved & synced');
|
|
30
|
+
});
|
|
31
|
+
it('reports Saved locally when offline is ready but socket is disconnected', () => {
|
|
32
|
+
const out = describeOfflineStatus('disconnected', 'ready');
|
|
33
|
+
expect(out.tone).toBe('warn');
|
|
34
|
+
expect(out.label).toMatch(/Saved locally/);
|
|
35
|
+
});
|
|
36
|
+
it('reports Saved locally — reconnecting… while reconnecting', () => {
|
|
37
|
+
expect(describeOfflineStatus('connecting', 'ready').label).toMatch(/reconnecting/);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
describe('<OfflineStatus />', () => {
|
|
41
|
+
it('renders the resolved label + tone', () => {
|
|
42
|
+
render(_jsx(OfflineStatus, { connection: "connected", offline: "ready" }));
|
|
43
|
+
const chip = screen.getByTestId('offline-status');
|
|
44
|
+
expect(chip.textContent).toContain('Saved & synced');
|
|
45
|
+
expect(chip.dataset.tone).toBe('good');
|
|
46
|
+
});
|
|
47
|
+
it('switches tone when conditions change', () => {
|
|
48
|
+
const { rerender } = render(_jsx(OfflineStatus, { connection: "connected", offline: "ready" }));
|
|
49
|
+
expect(screen.getByTestId('offline-status').dataset.tone).toBe('good');
|
|
50
|
+
rerender(_jsx(OfflineStatus, { connection: "disconnected", offline: "ready" }));
|
|
51
|
+
expect(screen.getByTestId('offline-status').dataset.tone).toBe('warn');
|
|
52
|
+
rerender(_jsx(OfflineStatus, { connection: "connected", offline: "error" }));
|
|
53
|
+
expect(screen.getByTestId('offline-status').dataset.tone).toBe('bad');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=offline-status.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offline-status.test.js","sourceRoot":"","sources":["../../../src/__tests__/components/offline-status.test.tsx"],"names":[],"mappings":";AAAA,gCAAgC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEvD,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AAExF,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,CAAC,qBAAqB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACpE,MAAM,CAAC,qBAAqB,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACzE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,MAAM,GAAG,GAAG,qBAAqB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAA;QAC7D,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC7B,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAClC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;QACtE,MAAM,CAAC,qBAAqB,CAAC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C,WAAW,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACvE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presence-chips-helpers.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/components/presence-chips-helpers.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { nameToInitials } from '../../components/PresenceChips.js';
|
|
3
|
+
describe('nameToInitials', () => {
|
|
4
|
+
it('returns the first letter of a single name', () => {
|
|
5
|
+
expect(nameToInitials('Alice')).toBe('A');
|
|
6
|
+
});
|
|
7
|
+
it('returns the first letter of two name parts', () => {
|
|
8
|
+
expect(nameToInitials('Alice Cooper')).toBe('AC');
|
|
9
|
+
});
|
|
10
|
+
it('caps at two letters for three+ part names', () => {
|
|
11
|
+
expect(nameToInitials('Mary Jane Watson')).toBe('MJ');
|
|
12
|
+
});
|
|
13
|
+
it('uppercases the result', () => {
|
|
14
|
+
expect(nameToInitials('alice cooper')).toBe('AC');
|
|
15
|
+
});
|
|
16
|
+
it('trims surrounding whitespace before processing', () => {
|
|
17
|
+
expect(nameToInitials(' Alice ')).toBe('A');
|
|
18
|
+
});
|
|
19
|
+
it('collapses multiple whitespace separators', () => {
|
|
20
|
+
expect(nameToInitials('Alice Cooper')).toBe('AC');
|
|
21
|
+
});
|
|
22
|
+
it('falls back to "?" for an empty string', () => {
|
|
23
|
+
expect(nameToInitials('')).toBe('?');
|
|
24
|
+
});
|
|
25
|
+
it('falls back to "?" for a whitespace-only string', () => {
|
|
26
|
+
expect(nameToInitials(' ')).toBe('?');
|
|
27
|
+
});
|
|
28
|
+
it('handles a single emoji name without crashing', () => {
|
|
29
|
+
const result = nameToInitials('🐱 Whiskers');
|
|
30
|
+
// JS upper-case is a no-op for the cat — test just confirms we don't crash
|
|
31
|
+
// and return *something* with two character-positions.
|
|
32
|
+
expect(result.length).toBeGreaterThan(0);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=presence-chips-helpers.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presence-chips-helpers.test.js","sourceRoot":"","sources":["../../../src/__tests__/components/presence-chips-helpers.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAElE,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACnD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACvD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QAC/B,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACnD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC/C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACtD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACtC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,MAAM,GAAG,cAAc,CAAC,aAAa,CAAC,CAAA;QAC5C,2EAA2E;QAC3E,uDAAuD;QACvD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active-editor.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/lib/active-editor.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
2
|
+
import { setActiveEditor, getActiveEditor, clearActiveEditorIf, subscribeActiveEditor, } from '../../lib/active-editor.js';
|
|
3
|
+
function fakeEditor() {
|
|
4
|
+
return {};
|
|
5
|
+
}
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
setActiveEditor(null);
|
|
8
|
+
});
|
|
9
|
+
describe('active-editor registry', () => {
|
|
10
|
+
it('stores and returns the active editor', () => {
|
|
11
|
+
const a = fakeEditor();
|
|
12
|
+
expect(getActiveEditor()).toBeNull();
|
|
13
|
+
setActiveEditor(a);
|
|
14
|
+
expect(getActiveEditor()).toBe(a);
|
|
15
|
+
});
|
|
16
|
+
it('replaces the active editor', () => {
|
|
17
|
+
const a = fakeEditor();
|
|
18
|
+
const b = fakeEditor();
|
|
19
|
+
setActiveEditor(a);
|
|
20
|
+
setActiveEditor(b);
|
|
21
|
+
expect(getActiveEditor()).toBe(b);
|
|
22
|
+
});
|
|
23
|
+
it('accepts null to clear the active editor', () => {
|
|
24
|
+
setActiveEditor(fakeEditor());
|
|
25
|
+
setActiveEditor(null);
|
|
26
|
+
expect(getActiveEditor()).toBeNull();
|
|
27
|
+
});
|
|
28
|
+
it('notifies subscribers when the active editor changes', () => {
|
|
29
|
+
const listener = vi.fn();
|
|
30
|
+
const unsubscribe = subscribeActiveEditor(listener);
|
|
31
|
+
setActiveEditor(fakeEditor());
|
|
32
|
+
expect(listener).toHaveBeenCalledTimes(1);
|
|
33
|
+
setActiveEditor(fakeEditor());
|
|
34
|
+
expect(listener).toHaveBeenCalledTimes(2);
|
|
35
|
+
unsubscribe();
|
|
36
|
+
setActiveEditor(fakeEditor());
|
|
37
|
+
expect(listener).toHaveBeenCalledTimes(2);
|
|
38
|
+
});
|
|
39
|
+
it('skips notifications when the same editor is set twice', () => {
|
|
40
|
+
const listener = vi.fn();
|
|
41
|
+
const a = fakeEditor();
|
|
42
|
+
subscribeActiveEditor(listener);
|
|
43
|
+
setActiveEditor(a);
|
|
44
|
+
setActiveEditor(a);
|
|
45
|
+
expect(listener).toHaveBeenCalledTimes(1);
|
|
46
|
+
});
|
|
47
|
+
it('clearActiveEditorIf clears only when matched', () => {
|
|
48
|
+
const a = fakeEditor();
|
|
49
|
+
const b = fakeEditor();
|
|
50
|
+
setActiveEditor(a);
|
|
51
|
+
clearActiveEditorIf(b);
|
|
52
|
+
expect(getActiveEditor()).toBe(a);
|
|
53
|
+
clearActiveEditorIf(a);
|
|
54
|
+
expect(getActiveEditor()).toBeNull();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=active-editor.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active-editor.test.js","sourceRoot":"","sources":["../../../src/__tests__/lib/active-editor.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7D,OAAO,EACL,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,4BAA4B,CAAA;AAEnC,SAAS,UAAU;IACjB,OAAO,EAAY,CAAA;AACrB,CAAC;AAED,UAAU,CAAC,GAAG,EAAE;IACd,eAAe,CAAC,IAAI,CAAC,CAAA;AACvB,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,CAAC,GAAG,UAAU,EAAE,CAAA;QACtB,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAA;QACpC,eAAe,CAAC,CAAC,CAAC,CAAA;QAClB,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,CAAC,GAAG,UAAU,EAAE,CAAA;QACtB,MAAM,CAAC,GAAG,UAAU,EAAE,CAAA;QACtB,eAAe,CAAC,CAAC,CAAC,CAAA;QAClB,eAAe,CAAC,CAAC,CAAC,CAAA;QAClB,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,eAAe,CAAC,UAAU,EAAE,CAAC,CAAA;QAC7B,eAAe,CAAC,IAAI,CAAC,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