@semiont/react-ui 0.2.34-build.90 → 0.2.34-build.92
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/{EventBusContext-BmzEcGHZ.d.mts → EventBusContext-DMI4uwYk.d.mts} +2 -2
- package/dist/{PdfAnnotationCanvas.client-VLNA5O5M.mjs → PdfAnnotationCanvas.client-HNYRKFDS.mjs} +10 -9
- package/dist/PdfAnnotationCanvas.client-HNYRKFDS.mjs.map +1 -0
- package/dist/{ar-4ZEORRW2.mjs → ar-MDB7HC5S.mjs} +45 -49
- package/dist/ar-MDB7HC5S.mjs.map +1 -0
- package/dist/{bn-SEDE5BQJ.mjs → bn-3SAV2ZEM.mjs} +45 -49
- package/dist/bn-3SAV2ZEM.mjs.map +1 -0
- package/dist/{chunk-C63BARI7.mjs → chunk-3FIQXKQF.mjs} +31 -31
- package/dist/{chunk-D7NBW4RV.mjs → chunk-JH7BXE2P.mjs} +45 -49
- package/dist/chunk-JH7BXE2P.mjs.map +1 -0
- package/dist/{chunk-M7SZRRIE.mjs → chunk-MWQ5CNKW.mjs} +13 -13
- package/dist/chunk-MWQ5CNKW.mjs.map +1 -0
- package/dist/{chunk-ULIET3MW.mjs → chunk-YI5IX5ZA.mjs} +1 -1
- package/dist/{chunk-ULIET3MW.mjs.map → chunk-YI5IX5ZA.mjs.map} +1 -1
- package/dist/{cs-7W4WF5WD.mjs → cs-AWCETEUV.mjs} +45 -49
- package/dist/cs-AWCETEUV.mjs.map +1 -0
- package/dist/{da-75XGBCBK.mjs → da-UZZHXYLC.mjs} +45 -49
- package/dist/da-UZZHXYLC.mjs.map +1 -0
- package/dist/{de-ODJVFLHM.mjs → de-LQFWN6S5.mjs} +45 -49
- package/dist/de-LQFWN6S5.mjs.map +1 -0
- package/dist/{el-C4PM4WB3.mjs → el-IWOETBJ7.mjs} +45 -49
- package/dist/el-IWOETBJ7.mjs.map +1 -0
- package/dist/{en-KJCJQ4OO.mjs → en-XWEPVTB4.mjs} +2 -6
- package/dist/{es-WD33R7QL.mjs → es-726NTS53.mjs} +45 -49
- package/dist/es-726NTS53.mjs.map +1 -0
- package/dist/{fa-2BP6V56P.mjs → fa-BVEJZT5S.mjs} +45 -49
- package/dist/fa-BVEJZT5S.mjs.map +1 -0
- package/dist/{fi-USRRW24J.mjs → fi-JBNCGGA6.mjs} +45 -49
- package/dist/fi-JBNCGGA6.mjs.map +1 -0
- package/dist/{fr-EC5S6WVF.mjs → fr-OLH7PNGI.mjs} +45 -49
- package/dist/fr-OLH7PNGI.mjs.map +1 -0
- package/dist/{he-7TBVIKAA.mjs → he-KOJQ4HMA.mjs} +45 -49
- package/dist/he-KOJQ4HMA.mjs.map +1 -0
- package/dist/{hi-FO4VIZLA.mjs → hi-BKJFZXAY.mjs} +45 -49
- package/dist/hi-BKJFZXAY.mjs.map +1 -0
- package/dist/{id-7U7GGVWY.mjs → id-DPLHJVNP.mjs} +45 -49
- package/dist/id-DPLHJVNP.mjs.map +1 -0
- package/dist/index.css +80 -80
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +216 -207
- package/dist/index.mjs +812 -759
- package/dist/index.mjs.map +1 -1
- package/dist/{it-Y4OPL6I2.mjs → it-JXHAM7NL.mjs} +45 -49
- package/dist/it-JXHAM7NL.mjs.map +1 -0
- package/dist/{ja-PK7SQL55.mjs → ja-DQRAO3PU.mjs} +45 -49
- package/dist/ja-DQRAO3PU.mjs.map +1 -0
- package/dist/{ko-L25PXMYD.mjs → ko-6IFCOP6F.mjs} +45 -49
- package/dist/ko-6IFCOP6F.mjs.map +1 -0
- package/dist/{ms-STH777QM.mjs → ms-KF5S2TLL.mjs} +45 -49
- package/dist/ms-KF5S2TLL.mjs.map +1 -0
- package/dist/{nl-Y7LECDDR.mjs → nl-2GUUZLQM.mjs} +45 -49
- package/dist/nl-2GUUZLQM.mjs.map +1 -0
- package/dist/{no-KEKCEWU6.mjs → no-2IBCZGEF.mjs} +45 -49
- package/dist/no-2IBCZGEF.mjs.map +1 -0
- package/dist/{pl-7A7OC75O.mjs → pl-ZEUBJ7YU.mjs} +45 -49
- package/dist/pl-ZEUBJ7YU.mjs.map +1 -0
- package/dist/{pt-35HTM7RA.mjs → pt-WLAFIZWQ.mjs} +45 -49
- package/dist/pt-WLAFIZWQ.mjs.map +1 -0
- package/dist/{ro-VAWL5KQA.mjs → ro-K56IXFGU.mjs} +45 -49
- package/dist/ro-K56IXFGU.mjs.map +1 -0
- package/dist/{sv-7ZK5EQEB.mjs → sv-VFJLMJRY.mjs} +45 -49
- package/dist/sv-VFJLMJRY.mjs.map +1 -0
- package/dist/test-utils.d.mts +2 -2
- package/dist/test-utils.mjs +3 -3
- package/dist/{th-UDWZ4X34.mjs → th-RICLQ2GW.mjs} +45 -49
- package/dist/th-RICLQ2GW.mjs.map +1 -0
- package/dist/{tr-4WMPK3UX.mjs → tr-SALXWE2M.mjs} +45 -49
- package/dist/tr-SALXWE2M.mjs.map +1 -0
- package/dist/{uk-SSLASQYJ.mjs → uk-3U3T3O2E.mjs} +45 -49
- package/dist/uk-3U3T3O2E.mjs.map +1 -0
- package/dist/{vi-IF42Z5PU.mjs → vi-LIVNZXOB.mjs} +45 -49
- package/dist/vi-LIVNZXOB.mjs.map +1 -0
- package/dist/{zh-HRQTNTAI.mjs → zh-KDUAZPX3.mjs} +45 -49
- package/dist/zh-KDUAZPX3.mjs.map +1 -0
- package/package.json +1 -1
- package/src/components/AnnotateReferencesProgressWidget.tsx +113 -0
- package/src/components/CodeMirrorRenderer.tsx +9 -27
- package/src/components/Toolbar.tsx +2 -2
- package/src/components/annotation/AnnotateToolbar.tsx +9 -9
- package/src/components/annotation/__tests__/AnnotateToolbar.test.tsx +17 -17
- package/src/components/image-annotation/AnnotationOverlay.tsx +13 -11
- package/src/components/image-annotation/SvgDrawingCanvas.tsx +8 -4
- package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +11 -9
- package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +1 -1
- package/src/components/resource/AnnotateView.tsx +17 -12
- package/src/components/resource/BrowseView.tsx +19 -50
- package/src/components/resource/ResourceViewer.tsx +28 -24
- package/src/components/resource/__tests__/BrowseView.test.tsx +27 -27
- package/src/components/resource/panels/AssessmentEntry.tsx +1 -1
- package/src/components/resource/panels/AssessmentPanel.tsx +16 -16
- package/src/components/resource/panels/{DetectSection.css → AssistSection.css} +79 -79
- package/src/components/resource/panels/{DetectSection.tsx → AssistSection.tsx} +46 -46
- package/src/components/resource/panels/CommentEntry.tsx +1 -1
- package/src/components/resource/panels/CommentsPanel.tsx +16 -16
- package/src/components/resource/panels/HighlightEntry.tsx +1 -1
- package/src/components/resource/panels/HighlightPanel.tsx +14 -14
- package/src/components/resource/panels/ReferenceEntry.tsx +5 -5
- package/src/components/resource/panels/ReferencesPanel.tsx +90 -103
- package/src/components/resource/panels/ResourceInfoPanel.tsx +2 -2
- package/src/components/resource/panels/TagEntry.tsx +1 -1
- package/src/components/resource/panels/TaggingPanel.tsx +53 -53
- package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +12 -22
- package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +12 -12
- package/src/components/resource/panels/__tests__/{DetectSection.test.tsx → AssistSection.test.tsx} +109 -108
- package/src/components/resource/panels/__tests__/CommentEntry.test.tsx +8 -8
- package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +3 -3
- package/src/components/resource/panels/__tests__/{HighlightPanel.detectionProgress.test.tsx → HighlightPanel.annotationProgress.test.tsx} +56 -56
- package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +98 -95
- package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +3 -3
- package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +16 -16
- package/src/components/settings/SettingsPanel.tsx +29 -1
- package/src/features/resource-compose/components/ResourceComposePage.tsx +3 -0
- package/src/features/resource-viewer/__tests__/AnnotationCreationPending.test.tsx +36 -26
- package/src/features/resource-viewer/__tests__/AnnotationDeletionIntegration.test.tsx +26 -16
- package/src/features/resource-viewer/__tests__/{DetectionProgressDismissal.test.tsx → AnnotationProgressDismissal.test.tsx} +48 -38
- package/src/features/resource-viewer/__tests__/DetectionFlowBug.test.tsx +59 -49
- package/src/features/resource-viewer/__tests__/DetectionFlowIntegration.test.tsx +55 -33
- package/src/features/resource-viewer/__tests__/GenerationFlowIntegration.test.tsx +38 -36
- package/src/features/resource-viewer/__tests__/ResolutionFlowIntegration.test.tsx +41 -31
- package/src/features/resource-viewer/__tests__/ResourceMutations.test.tsx +10 -10
- package/src/features/resource-viewer/__tests__/ToastNotifications.test.tsx +196 -0
- package/src/features/resource-viewer/__tests__/{detection-progress-flow.test.tsx → annotation-progress-flow.test.tsx} +51 -28
- package/src/features/resource-viewer/components/ResourceViewerPage.tsx +56 -51
- package/src/styles/core/buttons.css +3 -3
- package/src/styles/core/forms.css +2 -2
- package/src/styles/index.css +1 -1
- package/src/styles/motivations/motivation-assessment.css +9 -9
- package/src/styles/motivations/motivation-comment.css +9 -9
- package/src/styles/motivations/motivation-highlight.css +9 -9
- package/src/styles/motivations/motivation-reference.css +9 -9
- package/src/styles/motivations/motivation-tag.css +9 -9
- package/src/styles/utilities/focus-extended.css +6 -6
- package/translations/ar.json +44 -44
- package/translations/bn.json +44 -44
- package/translations/cs.json +44 -44
- package/translations/da.json +44 -44
- package/translations/de.json +44 -44
- package/translations/el.json +44 -44
- package/translations/en.json +44 -44
- package/translations/es.json +44 -44
- package/translations/fa.json +44 -44
- package/translations/fi.json +44 -44
- package/translations/fr.json +44 -44
- package/translations/he.json +44 -44
- package/translations/hi.json +44 -44
- package/translations/id.json +44 -44
- package/translations/it.json +44 -44
- package/translations/ja.json +44 -44
- package/translations/ko.json +44 -44
- package/translations/ms.json +44 -44
- package/translations/nl.json +44 -44
- package/translations/no.json +44 -44
- package/translations/pl.json +44 -44
- package/translations/pt.json +44 -44
- package/translations/ro.json +44 -44
- package/translations/sv.json +44 -44
- package/translations/th.json +44 -44
- package/translations/tr.json +44 -44
- package/translations/uk.json +44 -44
- package/translations/vi.json +44 -44
- package/translations/zh.json +44 -44
- package/dist/PdfAnnotationCanvas.client-VLNA5O5M.mjs.map +0 -1
- package/dist/ar-4ZEORRW2.mjs.map +0 -1
- package/dist/bn-SEDE5BQJ.mjs.map +0 -1
- package/dist/chunk-D7NBW4RV.mjs.map +0 -1
- package/dist/chunk-M7SZRRIE.mjs.map +0 -1
- package/dist/cs-7W4WF5WD.mjs.map +0 -1
- package/dist/da-75XGBCBK.mjs.map +0 -1
- package/dist/de-ODJVFLHM.mjs.map +0 -1
- package/dist/el-C4PM4WB3.mjs.map +0 -1
- package/dist/es-WD33R7QL.mjs.map +0 -1
- package/dist/fa-2BP6V56P.mjs.map +0 -1
- package/dist/fi-USRRW24J.mjs.map +0 -1
- package/dist/fr-EC5S6WVF.mjs.map +0 -1
- package/dist/he-7TBVIKAA.mjs.map +0 -1
- package/dist/hi-FO4VIZLA.mjs.map +0 -1
- package/dist/id-7U7GGVWY.mjs.map +0 -1
- package/dist/it-Y4OPL6I2.mjs.map +0 -1
- package/dist/ja-PK7SQL55.mjs.map +0 -1
- package/dist/ko-L25PXMYD.mjs.map +0 -1
- package/dist/ms-STH777QM.mjs.map +0 -1
- package/dist/nl-Y7LECDDR.mjs.map +0 -1
- package/dist/no-KEKCEWU6.mjs.map +0 -1
- package/dist/pl-7A7OC75O.mjs.map +0 -1
- package/dist/pt-35HTM7RA.mjs.map +0 -1
- package/dist/ro-VAWL5KQA.mjs.map +0 -1
- package/dist/sv-7ZK5EQEB.mjs.map +0 -1
- package/dist/th-UDWZ4X34.mjs.map +0 -1
- package/dist/tr-4WMPK3UX.mjs.map +0 -1
- package/dist/uk-SSLASQYJ.mjs.map +0 -1
- package/dist/vi-IF42Z5PU.mjs.map +0 -1
- package/dist/zh-HRQTNTAI.mjs.map +0 -1
- package/src/components/DetectionProgressWidget.tsx +0 -113
- /package/dist/{chunk-C63BARI7.mjs.map → chunk-3FIQXKQF.mjs.map} +0 -0
- /package/dist/{en-KJCJQ4OO.mjs.map → en-XWEPVTB4.mjs.map} +0 -0
|
@@ -25,7 +25,7 @@ function createEventTracker() {
|
|
|
25
25
|
events.push({ event: eventName, payload });
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
const panelEvents = ['
|
|
28
|
+
const panelEvents = ['annotate:assist-request'] as const;
|
|
29
29
|
|
|
30
30
|
panelEvents.forEach(eventName => {
|
|
31
31
|
const handler = trackEvent(eventName);
|
|
@@ -73,15 +73,14 @@ const renderWithEventBus = (component: React.ReactElement, tracker?: ReturnType<
|
|
|
73
73
|
vi.mock('../../../../contexts/TranslationContext', () => ({
|
|
74
74
|
useTranslations: vi.fn(() => (key: string, params?: Record<string, any>) => {
|
|
75
75
|
const translations: Record<string, string> = {
|
|
76
|
-
|
|
76
|
+
annotateReferences: 'Annotate References',
|
|
77
77
|
selectEntityTypes: 'Select entity types',
|
|
78
78
|
noEntityTypes: 'No entity types available',
|
|
79
79
|
select: 'Select',
|
|
80
80
|
deselect: 'Deselect',
|
|
81
81
|
typesSelected: '{count} type(s) selected',
|
|
82
|
-
|
|
82
|
+
annotate: 'Annotate',
|
|
83
83
|
found: 'Found {count}',
|
|
84
|
-
more: 'Detect More',
|
|
85
84
|
includeDescriptiveReferences: 'Include descriptive references',
|
|
86
85
|
descriptiveReferencesTooltip: 'Also find phrases like \'the CEO\', \'the tech giant\', \'the physicist\' (in addition to names)',
|
|
87
86
|
cancel: 'Cancel',
|
|
@@ -96,12 +95,12 @@ vi.mock('../../../../contexts/TranslationContext', () => ({
|
|
|
96
95
|
TranslationProvider: ({ children }: { children: React.ReactNode }) => children,
|
|
97
96
|
}));
|
|
98
97
|
|
|
99
|
-
// Mock
|
|
100
|
-
vi.mock('@/components/
|
|
101
|
-
|
|
102
|
-
<div data-testid="
|
|
98
|
+
// Mock AnnotateReferencesProgressWidget - simplified to avoid module import issues
|
|
99
|
+
vi.mock('@/components/AnnotateReferencesProgressWidget', () => ({
|
|
100
|
+
AnnotateReferencesProgressWidget: ({ progress }: any) => (
|
|
101
|
+
<div data-testid="annotation-progress-widget">
|
|
103
102
|
<div data-testid="progress-data">{JSON.stringify(progress)}</div>
|
|
104
|
-
<button title="Cancel
|
|
103
|
+
<button title="Cancel Annotation">Cancel</button>
|
|
105
104
|
</div>
|
|
106
105
|
),
|
|
107
106
|
}));
|
|
@@ -119,8 +118,8 @@ describe('ReferencesPanel Component', () => {
|
|
|
119
118
|
|
|
120
119
|
const defaultProps = {
|
|
121
120
|
allEntityTypes: ['Person', 'Organization', 'Location', 'Date'],
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
isAssisting: false,
|
|
122
|
+
progress: null,
|
|
124
123
|
annotateMode: true,
|
|
125
124
|
Link: MockLink,
|
|
126
125
|
routes: mockRoutes,
|
|
@@ -140,7 +139,7 @@ describe('ReferencesPanel Component', () => {
|
|
|
140
139
|
it('should render panel with title', () => {
|
|
141
140
|
renderWithEventBus(<ReferencesPanel {...defaultProps} />);
|
|
142
141
|
|
|
143
|
-
expect(screen.getByText('
|
|
142
|
+
expect(screen.getByText('Annotate References')).toBeInTheDocument();
|
|
144
143
|
});
|
|
145
144
|
|
|
146
145
|
it('should render all entity type buttons', () => {
|
|
@@ -161,7 +160,7 @@ describe('ReferencesPanel Component', () => {
|
|
|
161
160
|
it('should render start detection button', () => {
|
|
162
161
|
renderWithEventBus(<ReferencesPanel {...defaultProps} />);
|
|
163
162
|
|
|
164
|
-
expect(screen.getByTitle('
|
|
163
|
+
expect(screen.getByTitle('Annotate')).toBeInTheDocument();
|
|
165
164
|
});
|
|
166
165
|
});
|
|
167
166
|
|
|
@@ -271,11 +270,11 @@ describe('ReferencesPanel Component', () => {
|
|
|
271
270
|
});
|
|
272
271
|
});
|
|
273
272
|
|
|
274
|
-
describe('Start
|
|
273
|
+
describe('Start Annotate Button', () => {
|
|
275
274
|
it('should be disabled when no types selected', () => {
|
|
276
275
|
renderWithEventBus(<ReferencesPanel {...defaultProps} />);
|
|
277
276
|
|
|
278
|
-
const startButton = screen.getByTitle('
|
|
277
|
+
const startButton = screen.getByTitle('Annotate');
|
|
279
278
|
|
|
280
279
|
expect(startButton).toBeDisabled();
|
|
281
280
|
});
|
|
@@ -286,24 +285,24 @@ describe('ReferencesPanel Component', () => {
|
|
|
286
285
|
const personButton = screen.getByText('Person');
|
|
287
286
|
await userEvent.click(personButton);
|
|
288
287
|
|
|
289
|
-
const startButton = screen.getByTitle('
|
|
288
|
+
const startButton = screen.getByTitle('Annotate');
|
|
290
289
|
|
|
291
290
|
expect(startButton).not.toBeDisabled();
|
|
292
291
|
});
|
|
293
292
|
|
|
294
|
-
it('should emit
|
|
293
|
+
it('should emit annotate:detect-request event with selected types and includeDescriptiveReferences', async () => {
|
|
295
294
|
const tracker = createEventTracker();
|
|
296
295
|
renderWithEventBus(<ReferencesPanel {...defaultProps} />, tracker);
|
|
297
296
|
|
|
298
297
|
await userEvent.click(screen.getByText('Person'));
|
|
299
298
|
await userEvent.click(screen.getByText('Organization'));
|
|
300
299
|
|
|
301
|
-
const startButton = screen.getByTitle('
|
|
300
|
+
const startButton = screen.getByTitle('Annotate');
|
|
302
301
|
await userEvent.click(startButton);
|
|
303
302
|
|
|
304
303
|
await waitFor(() => {
|
|
305
304
|
expect(tracker.events.some(e =>
|
|
306
|
-
e.event === '
|
|
305
|
+
e.event === 'annotate:assist-request' &&
|
|
307
306
|
e.payload?.motivation === 'linking' &&
|
|
308
307
|
e.payload?.options?.entityTypes?.includes('Person') &&
|
|
309
308
|
e.payload?.options?.entityTypes?.includes('Organization') &&
|
|
@@ -312,7 +311,7 @@ describe('ReferencesPanel Component', () => {
|
|
|
312
311
|
});
|
|
313
312
|
});
|
|
314
313
|
|
|
315
|
-
it('should emit
|
|
314
|
+
it('should emit annotate:detect-request event with includeDescriptiveReferences when checkbox is checked', async () => {
|
|
316
315
|
const tracker = createEventTracker();
|
|
317
316
|
renderWithEventBus(<ReferencesPanel {...defaultProps} />, tracker);
|
|
318
317
|
|
|
@@ -323,12 +322,12 @@ describe('ReferencesPanel Component', () => {
|
|
|
323
322
|
const checkbox = checkboxLabel.previousElementSibling as HTMLInputElement;
|
|
324
323
|
await userEvent.click(checkbox);
|
|
325
324
|
|
|
326
|
-
const startButton = screen.getByTitle('
|
|
325
|
+
const startButton = screen.getByTitle('Annotate');
|
|
327
326
|
await userEvent.click(startButton);
|
|
328
327
|
|
|
329
328
|
await waitFor(() => {
|
|
330
329
|
expect(tracker.events.some(e =>
|
|
331
|
-
e.event === '
|
|
330
|
+
e.event === 'annotate:assist-request' &&
|
|
332
331
|
e.payload?.motivation === 'linking' &&
|
|
333
332
|
e.payload?.options?.entityTypes?.includes('Person') &&
|
|
334
333
|
e.payload?.options?.includeDescriptiveReferences === true
|
|
@@ -341,7 +340,7 @@ describe('ReferencesPanel Component', () => {
|
|
|
341
340
|
|
|
342
341
|
await userEvent.click(screen.getByText('Person'));
|
|
343
342
|
|
|
344
|
-
const startButton = screen.getByTitle('
|
|
343
|
+
const startButton = screen.getByTitle('Annotate');
|
|
345
344
|
await userEvent.click(startButton);
|
|
346
345
|
|
|
347
346
|
// Simulate detection starting
|
|
@@ -349,8 +348,8 @@ describe('ReferencesPanel Component', () => {
|
|
|
349
348
|
<EventBusProvider>
|
|
350
349
|
<ReferencesPanel
|
|
351
350
|
{...defaultProps}
|
|
352
|
-
|
|
353
|
-
|
|
351
|
+
isAssisting={true}
|
|
352
|
+
progress={{ completedEntityTypes: [] }}
|
|
354
353
|
/>
|
|
355
354
|
</EventBusProvider>
|
|
356
355
|
);
|
|
@@ -360,8 +359,8 @@ describe('ReferencesPanel Component', () => {
|
|
|
360
359
|
<EventBusProvider>
|
|
361
360
|
<ReferencesPanel
|
|
362
361
|
{...defaultProps}
|
|
363
|
-
|
|
364
|
-
|
|
362
|
+
isAssisting={false}
|
|
363
|
+
progress={{
|
|
365
364
|
completedEntityTypes: [{ entityType: 'Person', foundCount: 5 }],
|
|
366
365
|
}}
|
|
367
366
|
/>
|
|
@@ -375,10 +374,10 @@ describe('ReferencesPanel Component', () => {
|
|
|
375
374
|
it('should have proper styling when disabled', () => {
|
|
376
375
|
renderWithEventBus(<ReferencesPanel {...defaultProps} />);
|
|
377
376
|
|
|
378
|
-
const startButton = screen.getByTitle('
|
|
377
|
+
const startButton = screen.getByTitle('Annotate');
|
|
379
378
|
|
|
380
379
|
expect(startButton).toHaveClass('semiont-button');
|
|
381
|
-
expect(startButton).toHaveAttribute('data-variant', '
|
|
380
|
+
expect(startButton).toHaveAttribute('data-variant', 'assist');
|
|
382
381
|
expect(startButton).toHaveAttribute('data-type', 'reference');
|
|
383
382
|
expect(startButton).toBeDisabled();
|
|
384
383
|
});
|
|
@@ -388,10 +387,10 @@ describe('ReferencesPanel Component', () => {
|
|
|
388
387
|
|
|
389
388
|
await userEvent.click(screen.getByText('Person'));
|
|
390
389
|
|
|
391
|
-
const startButton = screen.getByTitle('
|
|
390
|
+
const startButton = screen.getByTitle('Annotate');
|
|
392
391
|
|
|
393
392
|
expect(startButton).toHaveClass('semiont-button');
|
|
394
|
-
expect(startButton).toHaveAttribute('data-variant', '
|
|
393
|
+
expect(startButton).toHaveAttribute('data-variant', 'assist');
|
|
395
394
|
expect(startButton).toHaveAttribute('data-type', 'reference');
|
|
396
395
|
expect(startButton).not.toBeDisabled();
|
|
397
396
|
});
|
|
@@ -402,12 +401,12 @@ describe('ReferencesPanel Component', () => {
|
|
|
402
401
|
renderWithEventBus(
|
|
403
402
|
<ReferencesPanel
|
|
404
403
|
{...defaultProps}
|
|
405
|
-
|
|
406
|
-
|
|
404
|
+
isAssisting={true}
|
|
405
|
+
progress={{ completedEntityTypes: [] }}
|
|
407
406
|
/>
|
|
408
407
|
);
|
|
409
408
|
|
|
410
|
-
expect(screen.getByTestId('
|
|
409
|
+
expect(screen.getByTestId('annotation-progress-widget')).toBeInTheDocument();
|
|
411
410
|
});
|
|
412
411
|
|
|
413
412
|
it('should pass progress data to widget', () => {
|
|
@@ -421,8 +420,8 @@ describe('ReferencesPanel Component', () => {
|
|
|
421
420
|
renderWithEventBus(
|
|
422
421
|
<ReferencesPanel
|
|
423
422
|
{...defaultProps}
|
|
424
|
-
|
|
425
|
-
|
|
423
|
+
isAssisting={true}
|
|
424
|
+
progress={progress}
|
|
426
425
|
/>
|
|
427
426
|
);
|
|
428
427
|
|
|
@@ -435,8 +434,8 @@ describe('ReferencesPanel Component', () => {
|
|
|
435
434
|
renderWithEventBus(
|
|
436
435
|
<ReferencesPanel
|
|
437
436
|
{...defaultProps}
|
|
438
|
-
|
|
439
|
-
|
|
437
|
+
isAssisting={true}
|
|
438
|
+
progress={{ completedEntityTypes: [] }}
|
|
440
439
|
/>
|
|
441
440
|
);
|
|
442
441
|
|
|
@@ -448,12 +447,12 @@ describe('ReferencesPanel Component', () => {
|
|
|
448
447
|
renderWithEventBus(
|
|
449
448
|
<ReferencesPanel
|
|
450
449
|
{...defaultProps}
|
|
451
|
-
|
|
452
|
-
|
|
450
|
+
isAssisting={true}
|
|
451
|
+
progress={{ completedEntityTypes: [] }}
|
|
453
452
|
/>
|
|
454
453
|
);
|
|
455
454
|
|
|
456
|
-
const cancelButton = screen.getByTitle('Cancel
|
|
455
|
+
const cancelButton = screen.getByTitle('Cancel Annotation');
|
|
457
456
|
expect(cancelButton).toBeInTheDocument();
|
|
458
457
|
});
|
|
459
458
|
});
|
|
@@ -463,8 +462,8 @@ describe('ReferencesPanel Component', () => {
|
|
|
463
462
|
const { rerender } = renderWithEventBus(
|
|
464
463
|
<ReferencesPanel
|
|
465
464
|
{...defaultProps}
|
|
466
|
-
|
|
467
|
-
|
|
465
|
+
isAssisting={false}
|
|
466
|
+
progress={{
|
|
468
467
|
completedEntityTypes: [
|
|
469
468
|
{ entityType: 'Person', foundCount: 5 },
|
|
470
469
|
{ entityType: 'Organization', foundCount: 3 },
|
|
@@ -473,13 +472,13 @@ describe('ReferencesPanel Component', () => {
|
|
|
473
472
|
/>
|
|
474
473
|
);
|
|
475
474
|
|
|
476
|
-
// Parent clears
|
|
475
|
+
// Parent clears progress after completion
|
|
477
476
|
rerender(
|
|
478
477
|
<EventBusProvider>
|
|
479
478
|
<ReferencesPanel
|
|
480
479
|
{...defaultProps}
|
|
481
|
-
|
|
482
|
-
|
|
480
|
+
isAssisting={false}
|
|
481
|
+
progress={null}
|
|
483
482
|
/>
|
|
484
483
|
</EventBusProvider>
|
|
485
484
|
);
|
|
@@ -492,8 +491,8 @@ describe('ReferencesPanel Component', () => {
|
|
|
492
491
|
const { rerender } = renderWithEventBus(
|
|
493
492
|
<ReferencesPanel
|
|
494
493
|
{...defaultProps}
|
|
495
|
-
|
|
496
|
-
|
|
494
|
+
isAssisting={false}
|
|
495
|
+
progress={{
|
|
497
496
|
completedEntityTypes: [{ entityType: 'Person', foundCount: 5 }],
|
|
498
497
|
}}
|
|
499
498
|
/>
|
|
@@ -501,7 +500,7 @@ describe('ReferencesPanel Component', () => {
|
|
|
501
500
|
|
|
502
501
|
rerender(
|
|
503
502
|
<EventBusProvider>
|
|
504
|
-
<ReferencesPanel {...defaultProps}
|
|
503
|
+
<ReferencesPanel {...defaultProps} isAssisting={false} progress={null} />
|
|
505
504
|
</EventBusProvider>
|
|
506
505
|
);
|
|
507
506
|
expect(screen.getByText(/Found.*5/i)).toBeInTheDocument();
|
|
@@ -511,8 +510,8 @@ describe('ReferencesPanel Component', () => {
|
|
|
511
510
|
const { rerender } = renderWithEventBus(
|
|
512
511
|
<ReferencesPanel
|
|
513
512
|
{...defaultProps}
|
|
514
|
-
|
|
515
|
-
|
|
513
|
+
isAssisting={false}
|
|
514
|
+
progress={{
|
|
516
515
|
completedEntityTypes: [{ entityType: 'Person', foundCount: 5 }],
|
|
517
516
|
}}
|
|
518
517
|
/>
|
|
@@ -520,18 +519,18 @@ describe('ReferencesPanel Component', () => {
|
|
|
520
519
|
|
|
521
520
|
rerender(
|
|
522
521
|
<EventBusProvider>
|
|
523
|
-
<ReferencesPanel {...defaultProps}
|
|
522
|
+
<ReferencesPanel {...defaultProps} isAssisting={false} progress={null} />
|
|
524
523
|
</EventBusProvider>
|
|
525
524
|
);
|
|
526
525
|
expect(screen.getByText('✓')).toBeInTheDocument();
|
|
527
526
|
});
|
|
528
527
|
|
|
529
|
-
it('should show
|
|
528
|
+
it('should show detection log and selection UI together after completion', () => {
|
|
530
529
|
const { rerender } = renderWithEventBus(
|
|
531
530
|
<ReferencesPanel
|
|
532
531
|
{...defaultProps}
|
|
533
|
-
|
|
534
|
-
|
|
532
|
+
isAssisting={false}
|
|
533
|
+
progress={{
|
|
535
534
|
completedEntityTypes: [{ entityType: 'Person', foundCount: 5 }],
|
|
536
535
|
}}
|
|
537
536
|
/>
|
|
@@ -539,18 +538,21 @@ describe('ReferencesPanel Component', () => {
|
|
|
539
538
|
|
|
540
539
|
rerender(
|
|
541
540
|
<EventBusProvider>
|
|
542
|
-
<ReferencesPanel {...defaultProps}
|
|
541
|
+
<ReferencesPanel {...defaultProps} isAssisting={false} progress={null} />
|
|
543
542
|
</EventBusProvider>
|
|
544
543
|
);
|
|
545
|
-
|
|
544
|
+
|
|
545
|
+
// Should show both the completed log AND the selection UI
|
|
546
|
+
expect(screen.getByText('Person:')).toBeInTheDocument(); // Log entry
|
|
547
|
+
expect(screen.getByText('Select entity types')).toBeInTheDocument(); // Selection UI
|
|
546
548
|
});
|
|
547
549
|
|
|
548
|
-
it('should
|
|
550
|
+
it('should show selection UI immediately after detection completes', async () => {
|
|
549
551
|
const { rerender } = renderWithEventBus(
|
|
550
552
|
<ReferencesPanel
|
|
551
553
|
{...defaultProps}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
+
isAssisting={false}
|
|
555
|
+
progress={{
|
|
554
556
|
completedEntityTypes: [{ entityType: 'Person', foundCount: 5 }],
|
|
555
557
|
}}
|
|
556
558
|
/>
|
|
@@ -558,30 +560,29 @@ describe('ReferencesPanel Component', () => {
|
|
|
558
560
|
|
|
559
561
|
rerender(
|
|
560
562
|
<EventBusProvider>
|
|
561
|
-
<ReferencesPanel {...defaultProps}
|
|
563
|
+
<ReferencesPanel {...defaultProps} isAssisting={false} progress={null} />
|
|
562
564
|
</EventBusProvider>
|
|
563
565
|
);
|
|
564
566
|
|
|
565
|
-
|
|
566
|
-
await userEvent.click(detectMoreButton);
|
|
567
|
-
|
|
568
|
-
// Should show selection UI again
|
|
567
|
+
// Selection UI should be immediately available (no button click needed)
|
|
569
568
|
expect(screen.getByText('Select entity types')).toBeInTheDocument();
|
|
570
|
-
expect(screen.getByText('Person')).toBeInTheDocument();
|
|
569
|
+
expect(screen.getByText('Person')).toBeInTheDocument(); // Entity type chip
|
|
571
570
|
});
|
|
572
571
|
|
|
573
572
|
it('should not show log when empty', () => {
|
|
574
573
|
renderWithEventBus(
|
|
575
574
|
<ReferencesPanel
|
|
576
575
|
{...defaultProps}
|
|
577
|
-
|
|
578
|
-
|
|
576
|
+
isAssisting={false}
|
|
577
|
+
progress={{
|
|
579
578
|
completedEntityTypes: [],
|
|
580
579
|
}}
|
|
581
580
|
/>
|
|
582
581
|
);
|
|
583
582
|
|
|
584
|
-
|
|
583
|
+
// Should not show any log items (but selection UI should still be visible)
|
|
584
|
+
expect(screen.queryByText('✓')).not.toBeInTheDocument();
|
|
585
|
+
expect(screen.getByText('Select entity types')).toBeInTheDocument();
|
|
585
586
|
});
|
|
586
587
|
});
|
|
587
588
|
|
|
@@ -597,14 +598,14 @@ describe('ReferencesPanel Component', () => {
|
|
|
597
598
|
<EventBusProvider>
|
|
598
599
|
<ReferencesPanel
|
|
599
600
|
{...defaultProps}
|
|
600
|
-
|
|
601
|
-
|
|
601
|
+
isAssisting={true}
|
|
602
|
+
progress={{ completedEntityTypes: [] }}
|
|
602
603
|
/>
|
|
603
604
|
</EventBusProvider>
|
|
604
605
|
);
|
|
605
606
|
|
|
606
607
|
// Detecting state
|
|
607
|
-
expect(screen.getByTestId('
|
|
608
|
+
expect(screen.getByTestId('annotation-progress-widget')).toBeInTheDocument();
|
|
608
609
|
expect(screen.queryByText('Select entity types')).not.toBeInTheDocument();
|
|
609
610
|
});
|
|
610
611
|
|
|
@@ -612,58 +613,60 @@ describe('ReferencesPanel Component', () => {
|
|
|
612
613
|
const { rerender } = renderWithEventBus(
|
|
613
614
|
<ReferencesPanel
|
|
614
615
|
{...defaultProps}
|
|
615
|
-
|
|
616
|
-
|
|
616
|
+
isAssisting={true}
|
|
617
|
+
progress={{ completedEntityTypes: [] }}
|
|
617
618
|
/>
|
|
618
619
|
);
|
|
619
620
|
|
|
620
621
|
// Detecting
|
|
621
|
-
expect(screen.getByTestId('
|
|
622
|
+
expect(screen.getByTestId('annotation-progress-widget')).toBeInTheDocument();
|
|
622
623
|
|
|
623
624
|
// Complete - first trigger useEffect to copy to lastDetectionLog
|
|
624
625
|
rerender(
|
|
625
626
|
<EventBusProvider>
|
|
626
627
|
<ReferencesPanel
|
|
627
628
|
{...defaultProps}
|
|
628
|
-
|
|
629
|
-
|
|
629
|
+
isAssisting={false}
|
|
630
|
+
progress={{
|
|
630
631
|
completedEntityTypes: [{ entityType: 'Person', foundCount: 5 }],
|
|
631
632
|
}}
|
|
632
633
|
/>
|
|
633
634
|
</EventBusProvider>
|
|
634
635
|
);
|
|
635
636
|
|
|
636
|
-
// Then clear
|
|
637
|
+
// Then clear progress to show the log
|
|
637
638
|
rerender(
|
|
638
639
|
<EventBusProvider>
|
|
639
|
-
<ReferencesPanel {...defaultProps}
|
|
640
|
+
<ReferencesPanel {...defaultProps} isAssisting={false} progress={null} />
|
|
640
641
|
</EventBusProvider>
|
|
641
642
|
);
|
|
642
643
|
|
|
643
|
-
expect(screen.queryByTestId('
|
|
644
|
-
|
|
644
|
+
expect(screen.queryByTestId('annotation-progress-widget')).not.toBeInTheDocument();
|
|
645
|
+
// Both log and selection UI should be visible
|
|
646
|
+
expect(screen.getByText('Person:')).toBeInTheDocument();
|
|
647
|
+
expect(screen.getByText('Select entity types')).toBeInTheDocument();
|
|
645
648
|
});
|
|
646
649
|
|
|
647
|
-
it('should
|
|
650
|
+
it('should show selection UI after detection completes', async () => {
|
|
648
651
|
const { rerender } = renderWithEventBus(
|
|
649
652
|
<ReferencesPanel
|
|
650
653
|
{...defaultProps}
|
|
651
|
-
|
|
652
|
-
|
|
654
|
+
isAssisting={false}
|
|
655
|
+
progress={{
|
|
653
656
|
completedEntityTypes: [{ entityType: 'Person', foundCount: 5 }],
|
|
654
657
|
}}
|
|
655
658
|
/>
|
|
656
659
|
);
|
|
657
660
|
|
|
658
|
-
// Clear
|
|
661
|
+
// Clear progress to show the log
|
|
659
662
|
rerender(
|
|
660
663
|
<EventBusProvider>
|
|
661
|
-
<ReferencesPanel {...defaultProps}
|
|
664
|
+
<ReferencesPanel {...defaultProps} isAssisting={false} progress={null} />
|
|
662
665
|
</EventBusProvider>
|
|
663
666
|
);
|
|
664
667
|
|
|
665
|
-
|
|
666
|
-
|
|
668
|
+
// Selection UI should be immediately available
|
|
669
|
+
expect(screen.getByText('Select entity types')).toBeInTheDocument();
|
|
667
670
|
|
|
668
671
|
rerender(
|
|
669
672
|
<EventBusProvider>
|
|
@@ -743,8 +746,8 @@ describe('ReferencesPanel Component', () => {
|
|
|
743
746
|
renderWithEventBus(
|
|
744
747
|
<ReferencesPanel
|
|
745
748
|
{...defaultProps}
|
|
746
|
-
|
|
747
|
-
|
|
749
|
+
isAssisting={false}
|
|
750
|
+
progress={{
|
|
748
751
|
completedEntityTypes: [{ entityType: 'Person', foundCount: 0 }],
|
|
749
752
|
}}
|
|
750
753
|
/>
|
|
@@ -753,13 +756,13 @@ describe('ReferencesPanel Component', () => {
|
|
|
753
756
|
expect(screen.getByText(/Found.*0/i)).toBeInTheDocument();
|
|
754
757
|
});
|
|
755
758
|
|
|
756
|
-
it('should handle undefined
|
|
759
|
+
it('should handle undefined progress', () => {
|
|
757
760
|
expect(() => {
|
|
758
761
|
renderWithEventBus(
|
|
759
762
|
<ReferencesPanel
|
|
760
763
|
{...defaultProps}
|
|
761
|
-
|
|
762
|
-
|
|
764
|
+
isAssisting={false}
|
|
765
|
+
progress={undefined as any}
|
|
763
766
|
/>
|
|
764
767
|
);
|
|
765
768
|
}).not.toThrow();
|
|
@@ -787,14 +790,14 @@ describe('ReferencesPanel Component', () => {
|
|
|
787
790
|
// The emoji is no longer in the title (it's only in the tab now)
|
|
788
791
|
const title = screen.getByRole('heading', { level: 2 });
|
|
789
792
|
expect(title.textContent).not.toContain('🔵');
|
|
790
|
-
expect(title.textContent).toContain('
|
|
793
|
+
expect(title.textContent).toContain('title');
|
|
791
794
|
});
|
|
792
795
|
|
|
793
796
|
it('should have proper button layout', () => {
|
|
794
797
|
renderWithEventBus(<ReferencesPanel {...defaultProps} />);
|
|
795
798
|
|
|
796
799
|
const buttonContainer = screen.getByText('Person').parentElement;
|
|
797
|
-
expect(buttonContainer).toHaveClass('semiont-
|
|
800
|
+
expect(buttonContainer).toHaveClass('semiont-assist-widget__chips');
|
|
798
801
|
});
|
|
799
802
|
});
|
|
800
803
|
|
|
@@ -66,7 +66,7 @@ function createEventTracker() {
|
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
const resourceEvents = [
|
|
69
|
-
'
|
|
69
|
+
'generate:clone',
|
|
70
70
|
'resource:archive',
|
|
71
71
|
'resource:unarchive',
|
|
72
72
|
] as const;
|
|
@@ -248,7 +248,7 @@ describe('ResourceInfoPanel Component', () => {
|
|
|
248
248
|
expect(screen.getByText('Generate a shareable clone link for this resource')).toBeInTheDocument();
|
|
249
249
|
});
|
|
250
250
|
|
|
251
|
-
it('should emit
|
|
251
|
+
it('should emit generate:clone event when clone button clicked', async () => {
|
|
252
252
|
const tracker = createEventTracker();
|
|
253
253
|
renderWithEventBus(
|
|
254
254
|
<ResourceInfoPanel
|
|
@@ -261,7 +261,7 @@ describe('ResourceInfoPanel Component', () => {
|
|
|
261
261
|
fireEvent.click(button);
|
|
262
262
|
|
|
263
263
|
await waitFor(() => {
|
|
264
|
-
expect(tracker.events.some(e => e.event === '
|
|
264
|
+
expect(tracker.events.some(e => e.event === 'generate:clone')).toBe(true);
|
|
265
265
|
});
|
|
266
266
|
});
|
|
267
267
|
});
|
|
@@ -29,7 +29,7 @@ function createEventTracker() {
|
|
|
29
29
|
events.push({ event: eventName, payload });
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
const panelEvents = ['
|
|
32
|
+
const panelEvents = ['annotate:create', 'annotate:assist-request'] as const;
|
|
33
33
|
|
|
34
34
|
panelEvents.forEach(eventName => {
|
|
35
35
|
const handler = trackEvent(eventName);
|
|
@@ -87,8 +87,8 @@ vi.mock('../../../../contexts/TranslationContext', () => ({
|
|
|
87
87
|
schemaLegal: 'Legal (IRAC)',
|
|
88
88
|
schemaScientific: 'Scientific (IMRAD)',
|
|
89
89
|
schemaArgument: 'Argument',
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
annotateTags: 'Annotate Tags',
|
|
91
|
+
annotate: 'Annotate',
|
|
92
92
|
cancel: 'Cancel',
|
|
93
93
|
fragmentSelected: 'Fragment selected',
|
|
94
94
|
selectAll: 'Select All',
|
|
@@ -354,7 +354,7 @@ describe('TaggingPanel Component', () => {
|
|
|
354
354
|
expect(screen.getByText(/Select category/)).toBeInTheDocument();
|
|
355
355
|
});
|
|
356
356
|
|
|
357
|
-
it('should emit
|
|
357
|
+
it('should emit annotate:createevent when category is selected', async () => {
|
|
358
358
|
const tracker = createEventTracker();
|
|
359
359
|
const pendingAnnotation = createPendingAnnotation('Selected text');
|
|
360
360
|
|
|
@@ -378,7 +378,7 @@ describe('TaggingPanel Component', () => {
|
|
|
378
378
|
|
|
379
379
|
await waitFor(() => {
|
|
380
380
|
expect(tracker.events.some(e =>
|
|
381
|
-
e.event === '
|
|
381
|
+
e.event === 'annotate:create' &&
|
|
382
382
|
e.payload?.motivation === 'tagging' &&
|
|
383
383
|
e.payload?.body?.[0]?.value === 'Issue' &&
|
|
384
384
|
e.payload?.body?.[0]?.type === 'TextualBody'
|
|
@@ -407,7 +407,7 @@ describe('TaggingPanel Component', () => {
|
|
|
407
407
|
await userEvent.selectOptions(categorySelect!, 'Rule');
|
|
408
408
|
|
|
409
409
|
await waitFor(() => {
|
|
410
|
-
const createEvent = tracker.events.find(e => e.event === '
|
|
410
|
+
const createEvent = tracker.events.find(e => e.event === 'annotate:create');
|
|
411
411
|
expect(createEvent).toBeDefined();
|
|
412
412
|
const body: any[] = createEvent!.payload.body;
|
|
413
413
|
|
|
@@ -482,7 +482,7 @@ describe('TaggingPanel Component', () => {
|
|
|
482
482
|
/>
|
|
483
483
|
);
|
|
484
484
|
|
|
485
|
-
expect(screen.getByText(/
|
|
485
|
+
expect(screen.getByText(/Annotate Tags/)).toBeInTheDocument();
|
|
486
486
|
});
|
|
487
487
|
|
|
488
488
|
it('should not render detection section when annotateMode is false', () => {
|
|
@@ -493,7 +493,7 @@ describe('TaggingPanel Component', () => {
|
|
|
493
493
|
/>
|
|
494
494
|
);
|
|
495
495
|
|
|
496
|
-
expect(screen.queryByText(/
|
|
496
|
+
expect(screen.queryByText(/Annotate Tags/)).not.toBeInTheDocument();
|
|
497
497
|
});
|
|
498
498
|
|
|
499
499
|
it('should show schema selector in detection section', () => {
|
|
@@ -542,8 +542,8 @@ describe('TaggingPanel Component', () => {
|
|
|
542
542
|
/>
|
|
543
543
|
);
|
|
544
544
|
|
|
545
|
-
const
|
|
546
|
-
expect(
|
|
545
|
+
const annotateButton = screen.getByRole('button', { name: /✨ Annotate/i });
|
|
546
|
+
expect(annotateButton).toBeDisabled();
|
|
547
547
|
});
|
|
548
548
|
|
|
549
549
|
it('should enable detect button when categories are selected', async () => {
|
|
@@ -557,11 +557,11 @@ describe('TaggingPanel Component', () => {
|
|
|
557
557
|
const issueCheckbox = screen.getByLabelText(/Issue/);
|
|
558
558
|
await userEvent.click(issueCheckbox);
|
|
559
559
|
|
|
560
|
-
const
|
|
561
|
-
expect(
|
|
560
|
+
const annotateButton = screen.getByRole('button', { name: /✨ Annotate/i });
|
|
561
|
+
expect(annotateButton).not.toBeDisabled();
|
|
562
562
|
});
|
|
563
563
|
|
|
564
|
-
it('should emit
|
|
564
|
+
it('should emit annotate:detect-request event with selected schema and categories', async () => {
|
|
565
565
|
const tracker = createEventTracker();
|
|
566
566
|
renderWithEventBus(
|
|
567
567
|
<TaggingPanel
|
|
@@ -577,12 +577,12 @@ describe('TaggingPanel Component', () => {
|
|
|
577
577
|
await userEvent.click(issueCheckbox);
|
|
578
578
|
await userEvent.click(ruleCheckbox);
|
|
579
579
|
|
|
580
|
-
const
|
|
581
|
-
await userEvent.click(
|
|
580
|
+
const annotateButton = screen.getByRole('button', { name: /✨ Annotate/i });
|
|
581
|
+
await userEvent.click(annotateButton);
|
|
582
582
|
|
|
583
583
|
await waitFor(() => {
|
|
584
584
|
expect(tracker.events.some(e =>
|
|
585
|
-
e.event === '
|
|
585
|
+
e.event === 'annotate:assist-request' &&
|
|
586
586
|
e.payload?.motivation === 'tagging' &&
|
|
587
587
|
e.payload?.options?.schemaId === 'legal-irac' &&
|
|
588
588
|
e.payload?.options?.categories?.includes('Issue') &&
|