@xynolog/react-ui 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/README.md +26 -46
  2. package/package.json +12 -9
  3. package/src/components/Button/Button.tsx +0 -188
  4. package/src/components/Button/__tests__/Button.test.tsx +0 -449
  5. package/src/components/CodeMirrorRenderer.tsx +0 -536
  6. package/src/components/DelegateProgress.tsx +0 -308
  7. package/src/components/ErrorBoundary.tsx +0 -174
  8. package/src/components/ItemFoundLog.tsx +0 -42
  9. package/src/components/LiveRegion.tsx +0 -261
  10. package/src/components/ProtectedErrorBoundary.tsx +0 -114
  11. package/src/components/ResizeHandle.tsx +0 -167
  12. package/src/components/ResourceTagsInline.tsx +0 -120
  13. package/src/components/SessionExpiryBanner.tsx +0 -74
  14. package/src/components/SessionTimer.tsx +0 -17
  15. package/src/components/StatusDisplay.tsx +0 -131
  16. package/src/components/Toast.tsx +0 -217
  17. package/src/components/Toolbar.tsx +0 -194
  18. package/src/components/UserMenuSkeleton.tsx +0 -13
  19. package/src/components/__tests__/DelegateProgress.denominator.test.tsx +0 -102
  20. package/src/components/__tests__/DelegateProgress.test.tsx +0 -649
  21. package/src/components/__tests__/ErrorBoundary.test.tsx +0 -565
  22. package/src/components/__tests__/LiveRegion.a11y.test.tsx +0 -258
  23. package/src/components/__tests__/LiveRegion.hooks.test.tsx +0 -140
  24. package/src/components/__tests__/ProtectedErrorBoundary.test.tsx +0 -225
  25. package/src/components/__tests__/ResizeHandle.test.tsx +0 -159
  26. package/src/components/__tests__/ResourceTagsInline.test.tsx +0 -325
  27. package/src/components/__tests__/SessionExpiryBanner.test.tsx +0 -124
  28. package/src/components/__tests__/SessionTimer.test.tsx +0 -199
  29. package/src/components/__tests__/StatusDisplay.test.tsx +0 -179
  30. package/src/components/__tests__/Toast.test.tsx +0 -96
  31. package/src/components/__tests__/Toolbar.test.tsx +0 -111
  32. package/src/components/__tests__/UserMenuSkeleton.test.tsx +0 -182
  33. package/src/components/annotation/AnchoredTextNotice.tsx +0 -36
  34. package/src/components/annotation/AnnotateToolbar.tsx +0 -531
  35. package/src/components/annotation/__tests__/AnnotateToolbar.display.test.tsx +0 -127
  36. package/src/components/annotation/__tests__/AnnotateToolbar.test.tsx +0 -304
  37. package/src/components/annotation-popups/JsonLdView.tsx +0 -127
  38. package/src/components/annotation-popups/SharedPopupElements.tsx +0 -131
  39. package/src/components/annotation-popups/__tests__/JsonLdView.test.tsx +0 -432
  40. package/src/components/annotation-popups/__tests__/SharedPopupElements.test.tsx +0 -297
  41. package/src/components/branding/XynologBranding.tsx +0 -41
  42. package/src/components/branding/__tests__/XynologBranding.test.tsx +0 -383
  43. package/src/components/error-states/ResourceErrorState.tsx +0 -30
  44. package/src/components/error-states/__tests__/ResourceErrorState.test.tsx +0 -102
  45. package/src/components/image-annotation/AnnotationOverlay.tsx +0 -307
  46. package/src/components/image-annotation/SvgDrawingCanvas.tsx +0 -514
  47. package/src/components/image-annotation/__tests__/AnnotationOverlay.click.test.tsx +0 -169
  48. package/src/components/image-annotation/__tests__/AnnotationOverlay.hover.test.tsx +0 -83
  49. package/src/components/image-annotation/__tests__/SvgDrawingCanvas.annotate-gate.test.tsx +0 -228
  50. package/src/components/image-annotation/__tests__/SvgDrawingCanvas.click.test.tsx +0 -204
  51. package/src/components/layout/LeftSidebar.tsx +0 -150
  52. package/src/components/layout/PageLayout.tsx +0 -49
  53. package/src/components/layout/SkipLinks.tsx +0 -36
  54. package/src/components/layout/UnifiedHeader.tsx +0 -151
  55. package/src/components/layout/__tests__/LeftSidebar.test.tsx +0 -426
  56. package/src/components/layout/__tests__/PageLayout.test.tsx +0 -311
  57. package/src/components/layout/__tests__/SkipLinks.a11y.test.tsx +0 -218
  58. package/src/components/layout/__tests__/UnifiedHeader.test.tsx +0 -555
  59. package/src/components/loading-states/ComposeLoadingState.tsx +0 -19
  60. package/src/components/loading-states/ResourceLoadingState.tsx +0 -13
  61. package/src/components/loading-states/__tests__/ComposeLoadingState.test.tsx +0 -37
  62. package/src/components/loading-states/__tests__/ResourceLoadingState.test.tsx +0 -31
  63. package/src/components/modals/ComposeStep.tsx +0 -245
  64. package/src/components/modals/ConfigureGatherStep.tsx +0 -110
  65. package/src/components/modals/ConfigureGenerationStep.tsx +0 -458
  66. package/src/components/modals/ConfigureSearchStep.tsx +0 -124
  67. package/src/components/modals/ContextSummary.tsx +0 -317
  68. package/src/components/modals/CorpusPane.tsx +0 -96
  69. package/src/components/modals/DiscardPrompt.tsx +0 -44
  70. package/src/components/modals/GatherContextStep.tsx +0 -480
  71. package/src/components/modals/KbIdentityConflictModal.tsx +0 -122
  72. package/src/components/modals/KeyboardShortcutsHelpModal.tsx +0 -238
  73. package/src/components/modals/PermissionDeniedModal.tsx +0 -207
  74. package/src/components/modals/ReferenceWizardModal.tsx +0 -656
  75. package/src/components/modals/ResourceGenerateModal.tsx +0 -457
  76. package/src/components/modals/SearchModal.tsx +0 -334
  77. package/src/components/modals/SearchResultsStep.tsx +0 -117
  78. package/src/components/modals/SessionEndedModal.tsx +0 -148
  79. package/src/components/modals/WizardFooter.tsx +0 -72
  80. package/src/components/modals/__tests__/ComposeStep.test.tsx +0 -187
  81. package/src/components/modals/__tests__/ConfigureGatherStep.test.tsx +0 -92
  82. package/src/components/modals/__tests__/ConfigureGenerationStep.test.tsx +0 -574
  83. package/src/components/modals/__tests__/ConfigureSearchStep.test.tsx +0 -124
  84. package/src/components/modals/__tests__/GatherContextStep.resource.test.tsx +0 -702
  85. package/src/components/modals/__tests__/KbIdentityConflictModal.test.tsx +0 -102
  86. package/src/components/modals/__tests__/KeyboardShortcutsHelpModal.test.tsx +0 -115
  87. package/src/components/modals/__tests__/PermissionDeniedModal.test.tsx +0 -218
  88. package/src/components/modals/__tests__/ReferenceWizardModal.test.tsx +0 -936
  89. package/src/components/modals/__tests__/ResourceGenerateModal.test.tsx +0 -532
  90. package/src/components/modals/__tests__/SearchModal.accessibility.test.tsx +0 -95
  91. package/src/components/modals/__tests__/SearchModal.basic.test.tsx +0 -84
  92. package/src/components/modals/__tests__/SearchModal.keyboard.test.tsx +0 -162
  93. package/src/components/modals/__tests__/SearchModal.search-wiring.test.tsx +0 -237
  94. package/src/components/modals/__tests__/SearchModal.translations.test.tsx +0 -91
  95. package/src/components/modals/__tests__/SearchResultsStep.test.tsx +0 -95
  96. package/src/components/modals/__tests__/SessionEndedModal.test.tsx +0 -171
  97. package/src/components/modals/__tests__/WizardFooter.test.tsx +0 -446
  98. package/src/components/modals/__tests__/search-modal-harness.ts +0 -82
  99. package/src/components/navigation/CollapsibleResourceNavigation.tsx +0 -364
  100. package/src/components/navigation/NavigationMenu.tsx +0 -66
  101. package/src/components/navigation/ObservableLink.tsx +0 -90
  102. package/src/components/navigation/SimpleNavigation.tsx +0 -169
  103. package/src/components/navigation/SortableResourceTab.tsx +0 -122
  104. package/src/components/navigation/__tests__/NavigationMenu.a11y.test.tsx +0 -302
  105. package/src/components/navigation/__tests__/NavigationMenu.test.tsx +0 -399
  106. package/src/components/navigation/__tests__/ObservableLink.test.tsx +0 -85
  107. package/src/components/navigation/__tests__/SimpleNavigation.test.tsx +0 -193
  108. package/src/components/navigation/__tests__/SortableResourceTab.test.tsx +0 -421
  109. package/src/components/pdf-annotation/PdfAnnotationCanvas.client.tsx +0 -10
  110. package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +0 -632
  111. package/src/components/pdf-annotation/PdfPageView.tsx +0 -527
  112. package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.annotate-gate.test.tsx +0 -295
  113. package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.pixels-before-anchoring.test.tsx +0 -166
  114. package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +0 -1719
  115. package/src/components/pdf-annotation/__tests__/estimate-slot-height.test.ts +0 -61
  116. package/src/components/pdf-annotation/__tests__/rects-for-page.test.ts +0 -110
  117. package/src/components/pdf-annotation/estimate-slot-height.ts +0 -31
  118. package/src/components/pdf-annotation/rects-for-page.ts +0 -50
  119. package/src/components/resource/AnnotateView.tsx +0 -373
  120. package/src/components/resource/AnnotationHistory.tsx +0 -169
  121. package/src/components/resource/BrowseView.tsx +0 -440
  122. package/src/components/resource/DownloadFileLink.tsx +0 -53
  123. package/src/components/resource/HistoryEvent.tsx +0 -186
  124. package/src/components/resource/ResourceViewer.tsx +0 -617
  125. package/src/components/resource/__tests__/AnnotateView.code-point-offsets.test.tsx +0 -482
  126. package/src/components/resource/__tests__/AnnotateView.embeddable.test.tsx +0 -78
  127. package/src/components/resource/__tests__/AnnotateView.focus.test.tsx +0 -147
  128. package/src/components/resource/__tests__/AnnotateView.registry.test.tsx +0 -143
  129. package/src/components/resource/__tests__/AnnotationHistory.test.tsx +0 -257
  130. package/src/components/resource/__tests__/BrowseView.code-point-offsets.test.tsx +0 -123
  131. package/src/components/resource/__tests__/BrowseView.embeddable.test.tsx +0 -76
  132. package/src/components/resource/__tests__/BrowseView.links.test.tsx +0 -84
  133. package/src/components/resource/__tests__/BrowseView.overlay-async.test.tsx +0 -165
  134. package/src/components/resource/__tests__/BrowseView.reference-hover.test.tsx +0 -200
  135. package/src/components/resource/__tests__/BrowseView.registry.test.tsx +0 -57
  136. package/src/components/resource/__tests__/BrowseView.test.tsx +0 -915
  137. package/src/components/resource/__tests__/HistoryEvent.test.tsx +0 -571
  138. package/src/components/resource/__tests__/ResourceViewer.delete-failure.test.tsx +0 -103
  139. package/src/components/resource/__tests__/ResourceViewer.embeddable.test.tsx +0 -250
  140. package/src/components/resource/__tests__/ResourceViewer.mode-switch.test.tsx +0 -262
  141. package/src/components/resource/__tests__/ResourceViewer.multi-mount-invalidation.test.tsx +0 -166
  142. package/src/components/resource/__tests__/ResourceViewer.registry.test.tsx +0 -112
  143. package/src/components/resource/__tests__/ResourceViewer.toolbar-opt-out.test.tsx +0 -207
  144. package/src/components/resource/__tests__/ResourceViewer.toolbar-prefs.test.tsx +0 -274
  145. package/src/components/resource/__tests__/annotation-interactions.test.tsx +0 -116
  146. package/src/components/resource/__tests__/browse-renderers.dispatch.test.tsx +0 -183
  147. package/src/components/resource/__tests__/browse-renderers.test.tsx +0 -47
  148. package/src/components/resource/__tests__/download-link.test.tsx +0 -171
  149. package/src/components/resource/__tests__/event-formatting.test.ts +0 -379
  150. package/src/components/resource/__tests__/inline-embedding.test.tsx +0 -133
  151. package/src/components/resource/__tests__/media-completeness.test.tsx +0 -144
  152. package/src/components/resource/annotate-renderers.tsx +0 -186
  153. package/src/components/resource/browse-renderers.tsx +0 -133
  154. package/src/components/resource/event-formatting.ts +0 -393
  155. package/src/components/resource/panels/AssessmentEntry.tsx +0 -127
  156. package/src/components/resource/panels/AssessmentPanel.tsx +0 -309
  157. package/src/components/resource/panels/CollaborationPanel.tsx +0 -228
  158. package/src/components/resource/panels/CommentEntry.tsx +0 -242
  159. package/src/components/resource/panels/CommentsPanel.tsx +0 -320
  160. package/src/components/resource/panels/DelegateSection.tsx +0 -282
  161. package/src/components/resource/panels/DelegateShell.tsx +0 -134
  162. package/src/components/resource/panels/HighlightEntry.tsx +0 -83
  163. package/src/components/resource/panels/HighlightPanel.tsx +0 -212
  164. package/src/components/resource/panels/JsonLdPanel.tsx +0 -119
  165. package/src/components/resource/panels/PanelHeader.tsx +0 -22
  166. package/src/components/resource/panels/ReferenceEntry.tsx +0 -232
  167. package/src/components/resource/panels/ReferencesPanel.tsx +0 -626
  168. package/src/components/resource/panels/ResourceInfoPanel.tsx +0 -433
  169. package/src/components/resource/panels/StatisticsPanel.tsx +0 -145
  170. package/src/components/resource/panels/TagEntry.tsx +0 -87
  171. package/src/components/resource/panels/TaggingPanel.tsx +0 -554
  172. package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +0 -384
  173. package/src/components/resource/panels/__tests__/AssessmentEntry.test.tsx +0 -292
  174. package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +0 -685
  175. package/src/components/resource/panels/__tests__/CollaborationPanel.test.tsx +0 -685
  176. package/src/components/resource/panels/__tests__/CommentEntry.test.tsx +0 -750
  177. package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +0 -877
  178. package/src/components/resource/panels/__tests__/DelegateSection.test.tsx +0 -623
  179. package/src/components/resource/panels/__tests__/DelegateShell.test.tsx +0 -212
  180. package/src/components/resource/panels/__tests__/HighlightEntry.test.tsx +0 -236
  181. package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +0 -506
  182. package/src/components/resource/panels/__tests__/HighlightPanel.out-of-order.test.tsx +0 -132
  183. package/src/components/resource/panels/__tests__/JsonLdPanel.test.tsx +0 -230
  184. package/src/components/resource/panels/__tests__/PanelHeader.test.tsx +0 -54
  185. package/src/components/resource/panels/__tests__/ReferenceEntry.test.tsx +0 -578
  186. package/src/components/resource/panels/__tests__/ReferencesPanel.headless.test.tsx +0 -193
  187. package/src/components/resource/panels/__tests__/ReferencesPanel.observable-flow.test.tsx +0 -193
  188. package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +0 -1080
  189. package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +0 -812
  190. package/src/components/resource/panels/__tests__/ResourceInfoPanel.text-layer.test.tsx +0 -106
  191. package/src/components/resource/panels/__tests__/StatisticsPanel.test.tsx +0 -329
  192. package/src/components/resource/panels/__tests__/TagEntry.test.tsx +0 -250
  193. package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +0 -772
  194. package/src/components/resource/panels/__tests__/UnifiedAnnotationsPanel.delegated-job.test.tsx +0 -207
  195. package/src/components/resource/panels/__tests__/UnifiedAnnotationsPanel.failure.test.tsx +0 -89
  196. package/src/components/resource/panels/__tests__/agent-label.test.ts +0 -136
  197. package/src/components/resource/panels/agent-label.ts +0 -35
  198. package/src/components/settings/SettingsPanel.tsx +0 -251
  199. package/src/components/settings/__tests__/SettingsPanel.test.tsx +0 -260
  200. package/src/components/viewers/ImageViewer.tsx +0 -18
  201. package/src/components/viewers/__tests__/ImageViewer.test.tsx +0 -57
  202. package/src/components/viewers/index.ts +0 -1
  203. package/src/features/auth/__tests__/AuthErrorDisplay.test.tsx +0 -181
  204. package/src/features/auth/components/AuthErrorDisplay.tsx +0 -89
  205. package/src/features/moderate-entity-tags/__tests__/EntityTagsPage.test.tsx +0 -387
  206. package/src/features/moderate-entity-tags/components/EntityTagsPage.tsx +0 -161
  207. package/src/features/moderate-entity-tags/state/__tests__/entity-tags-state-unit.test.ts +0 -183
  208. package/src/features/moderate-entity-tags/state/entity-tags-state-unit.ts +0 -73
  209. package/src/features/moderate-recent/__tests__/RecentDocumentsPage.test.tsx +0 -422
  210. package/src/features/moderate-recent/components/RecentDocumentsPage.tsx +0 -117
  211. package/src/features/moderate-tag-schemas/__tests__/TagSchemasPage.test.tsx +0 -481
  212. package/src/features/moderate-tag-schemas/components/TagSchemasPage.tsx +0 -161
  213. package/src/features/resource-compose/__tests__/ResourceComposePage.test.tsx +0 -600
  214. package/src/features/resource-compose/__tests__/UploadProgressBar.test.tsx +0 -256
  215. package/src/features/resource-compose/components/ResourceComposePage.tsx +0 -809
  216. package/src/features/resource-compose/components/UploadProgressBar.tsx +0 -125
  217. package/src/features/resource-compose/state/__tests__/compose-page-state-unit.test.ts +0 -195
  218. package/src/features/resource-compose/state/compose-page-state-unit.ts +0 -187
  219. package/src/features/resource-discovery/__tests__/ResourceCard.test.tsx +0 -338
  220. package/src/features/resource-discovery/__tests__/ResourceDiscoveryPage.test.tsx +0 -449
  221. package/src/features/resource-discovery/components/ResourceCard.tsx +0 -80
  222. package/src/features/resource-discovery/components/ResourceDiscoveryPage.tsx +0 -330
  223. package/src/features/resource-discovery/state/__tests__/discover-state-unit.test.ts +0 -477
  224. package/src/features/resource-discovery/state/discover-state-unit.ts +0 -162
  225. package/src/features/resource-viewer/__tests__/ResourceViewerPage.content-loading.test.tsx +0 -260
  226. package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +0 -570
  227. package/src/features/resource-viewer/__tests__/generation-params.test.ts +0 -49
  228. package/src/features/resource-viewer/components/ResourceViewerPage.tsx +0 -1058
  229. package/src/features/resource-viewer/generation-params.ts +0 -23
  230. package/src/features/resource-viewer/hooks/__tests__/useResourceViewedReport.test.tsx +0 -77
  231. package/src/features/resource-viewer/hooks/useResourceViewedReport.ts +0 -38
  232. package/src/features/resource-viewer/state/__tests__/resource-loader-state-unit.test.ts +0 -178
  233. package/src/features/resource-viewer/state/__tests__/resource-viewer-page-state-unit.test.ts +0 -505
  234. package/src/features/resource-viewer/state/resource-loader-state-unit.ts +0 -93
  235. package/src/features/resource-viewer/state/resource-viewer-page-state-unit.ts +0 -156
@@ -1,574 +0,0 @@
1
- /**
2
- * The max-length control is bounded by the generation engine's
3
- * discovered output ceiling.
4
- *
5
- * With no ceiling known the control is bounded anyway: `min="100" max="4000"`.
6
- * A discovered ceiling takes the place of that hardcoded 4000, which for any
7
- * model above 4000 RAISES the cap, and for a smaller model lowers it to
8
- * something the provider will actually honour.
9
- */
10
- import { describe, it, expect, vi } from 'vitest';
11
- import { useState } from 'react';
12
- import { render, screen, fireEvent } from '@testing-library/react';
13
- import '@testing-library/jest-dom';
14
- import type { EngineWithLimits, GatheredContext } from '@xynolog/core';
15
- import { GENERATABLE_MEDIA_TYPES, capabilitiesOf } from '@xynolog/core';
16
- import {
17
- ConfigureGenerationStep,
18
- freshGenerationDraft,
19
- } from '../ConfigureGenerationStep';
20
- import type { GenerationDraft } from '../ConfigureGenerationStep';
21
-
22
- const translations = {
23
- resourceTitle: 'Title',
24
- resourceTitlePlaceholder: 'Title…',
25
- saveLocation: 'Save location',
26
- additionalInstructions: 'Instructions',
27
- additionalInstructionsPlaceholder: 'Instructions…',
28
- language: 'Language',
29
- languageHelp: 'Language help',
30
- creativity: 'Creativity',
31
- creativityFocused: 'Focused',
32
- creativityCreative: 'Creative',
33
- maxLength: 'Max length',
34
- maxLengthHelp: 'How long the generated resource may be.',
35
- // Named model + ceiling, so the bound is legible rather than mysterious.
36
- maxLengthCeiling: 'Limited to {{maxOutputTokens}} tokens by {{model}}.',
37
- outputFormat: 'Format',
38
- formatExtensionMismatch:
39
- 'Save location must end in {{extension}} to match the selected format.',
40
- back: 'Back',
41
- generate: 'Generate',
42
- };
43
-
44
- const context = {
45
- resources: [],
46
- annotations: [],
47
- } as unknown as GatheredContext;
48
-
49
- /** The wizard's initial draft. */
50
- const DRAFT: GenerationDraft = freshGenerationDraft('Untitled', 'en');
51
-
52
- const engineWithCeiling = (maxOutputTokens: number): EngineWithLimits => ({
53
- engine: { provider: 'anthropic', model: 'claude-sonnet-5' },
54
- jobs: [{ jobType: 'yield' }],
55
- limits: { contextTokens: 200_000, maxOutputTokens },
56
- });
57
-
58
- /**
59
- * The step is CONTROLLED — the wizard owns the draft so
60
- * Back cannot discard it. These tests therefore mount a tiny stateful harness rather
61
- * than the bare component: a `vi.fn()` for `onConfigChange` would swallow every edit
62
- * and quietly turn each assertion below into a test of nothing.
63
- */
64
- function Harness({
65
- generationEngine,
66
- defaultFolder,
67
- }: {
68
- generationEngine?: EngineWithLimits;
69
- defaultFolder?: string;
70
- }) {
71
- const [draft, setDraft] = useState(DRAFT);
72
- return (
73
- <ConfigureGenerationStep
74
- config={draft}
75
- onConfigChange={setDraft}
76
- {...(defaultFolder !== undefined ? { defaultFolder } : {})}
77
- context={context}
78
- onBack={vi.fn()}
79
- onGenerate={onGenerateSpy}
80
- translations={translations}
81
- {...(generationEngine ? { generationEngine } : {})}
82
- />
83
- );
84
- }
85
-
86
- let onGenerateSpy = vi.fn();
87
-
88
- function renderStep(
89
- generationEngine?: EngineWithLimits,
90
- defaultFolder?: string,
91
- ) {
92
- onGenerateSpy = vi.fn();
93
- const utils = render(
94
- <Harness
95
- {...(generationEngine ? { generationEngine } : {})}
96
- {...(defaultFolder !== undefined ? { defaultFolder } : {})}
97
- />,
98
- );
99
- const input = () => screen.getByLabelText('Max length') as HTMLInputElement;
100
- return { ...utils, input, props: { onGenerate: onGenerateSpy } };
101
- }
102
-
103
- function fillRequired() {
104
- fireEvent.change(screen.getByLabelText('Save location'), {
105
- target: { value: 'generated/out.md' },
106
- });
107
- }
108
-
109
- describe('ConfigureGenerationStep — ceiling awareness', () => {
110
- it('bounds the control by the engine ceiling and names it in help text', () => {
111
- const { input } = renderStep(engineWithCeiling(64_000));
112
-
113
- expect(input().max).toBe('64000');
114
- expect(
115
- screen.getByText(/Limited to 64000 tokens by claude-sonnet-5\./),
116
- ).toBeInTheDocument();
117
- });
118
-
119
- it('the ceiling sentence is a row-level footnote, never a column child', () => {
120
- // A full sentence inside the 5.5rem Max Length column wraps one word per
121
- // line and its height taxes the whole flex row — the void under the other
122
- // controls IS this caption. It renders full-width under the row instead.
123
- renderStep(engineWithCeiling(64_000));
124
-
125
- const help = screen.getByText(/Limited to 64000 tokens/);
126
- expect(help).toHaveClass('xynolog-form__help--row');
127
- expect(help.closest('.xynolog-form__field--narrow')).toBeNull();
128
- });
129
-
130
- it('will not commit a value above the ceiling', () => {
131
- // `max` on a number input does not prevent TYPING an over-value — it only
132
- // marks the field invalid. The ceiling is clamped on the control itself, so
133
- // assert the committed state, never the attribute alone.
134
- const { input } = renderStep(engineWithCeiling(2_000));
135
-
136
- fireEvent.change(input(), { target: { value: '9999' } });
137
-
138
- expect(input().value).toBe('2000');
139
- });
140
-
141
- it('clamps the 500 default down when the ceiling is smaller', () => {
142
- const { input } = renderStep(engineWithCeiling(300));
143
-
144
- expect(input().value).toBe('300');
145
- });
146
-
147
- it('re-bounds and clamps when the ceiling arrives AFTER mount', () => {
148
- // The case that decides whether this feature works in the app at all:
149
- // `browse.engines()` is asynchronous, so `generationEngine` is undefined on
150
- // first render and arrives later. An implementation that only consults the
151
- // ceiling in the `useState` initializer passes every test above and does
152
- // nothing in production.
153
- const { input, rerender } = renderStep(undefined);
154
-
155
- expect(input().max).toBe('4000');
156
- fireEvent.change(input(), { target: { value: '3000' } });
157
- expect(input().value).toBe('3000');
158
-
159
- rerender(<Harness generationEngine={engineWithCeiling(1_000)} />);
160
-
161
- expect(input().max).toBe('1000');
162
- // 3000 is now out of range and must not survive as a submittable value.
163
- expect(input().value).toBe('1000');
164
- });
165
-
166
- it('keeps a value that is still within a newly arrived ceiling', () => {
167
- const { input, rerender } = renderStep(undefined);
168
- fireEvent.change(input(), { target: { value: '800' } });
169
-
170
- rerender(<Harness generationEngine={engineWithCeiling(4_000)} />);
171
-
172
- expect(input().value).toBe('800');
173
- });
174
-
175
- it('falls back to the hardcoded bounds and copy without an engine', () => {
176
- // A missing ceiling is normal, never an error: the control keeps its
177
- // hardcoded bounds.
178
- const { input } = renderStep(undefined);
179
-
180
- expect(input().min).toBe('100');
181
- expect(input().max).toBe('4000');
182
- expect(
183
- screen.getByText('How long the generated resource may be.'),
184
- ).toBeInTheDocument();
185
- expect(screen.queryByText(/Limited to/)).not.toBeInTheDocument();
186
- });
187
-
188
- it('falls back when the engine is present but discovery could not answer', () => {
189
- const noLimits = engineWithCeiling(64_000);
190
- delete noLimits.limits;
191
- const { input } = renderStep(noLimits);
192
-
193
- expect(input().max).toBe('4000');
194
- expect(screen.queryByText(/Limited to/)).not.toBeInTheDocument();
195
- });
196
-
197
- it('submits the clamped value, not the typed one', () => {
198
- const { props } = renderStep(engineWithCeiling(1_500));
199
- const onGenerate = props.onGenerate;
200
-
201
- fillRequired();
202
- const input = screen.getByLabelText('Max length') as HTMLInputElement;
203
- fireEvent.change(input, { target: { value: '8000' } });
204
- fireEvent.click(screen.getByText(/Generate/));
205
-
206
- expect(onGenerate).toHaveBeenCalledTimes(1);
207
- expect(onGenerate.mock.calls[0]![0].maxTokens).toBe(1_500);
208
- });
209
-
210
- it('lets the field be cleared, and never submits NaN for it', () => {
211
- // A hazard the clamp must not carry: a bare `parseInt(e.target.value)`
212
- // handler yields NaN for an empty field, which React warns about and
213
- // which would travel into the job config. Clearing must stay possible (you
214
- // cannot retype a number otherwise), so the contract is about what
215
- // SUBMITS, not about forbidding the empty state.
216
- const { props } = renderStep(engineWithCeiling(4_000));
217
- const onGenerate = props.onGenerate;
218
- const input = screen.getByLabelText('Max length') as HTMLInputElement;
219
-
220
- fillRequired();
221
- fireEvent.change(input, { target: { value: '' } });
222
- expect(input.value).toBe('');
223
-
224
- fireEvent.click(screen.getByText(/Generate/));
225
-
226
- const submitted = onGenerate.mock.calls[0]![0].maxTokens;
227
- expect(Number.isFinite(submitted)).toBe(true);
228
- expect(submitted).toBeGreaterThanOrEqual(100);
229
- expect(submitted).toBeLessThanOrEqual(4_000);
230
- });
231
- });
232
-
233
- // The rest of the draft, same contract as the ceiling: every field reports to
234
- // the owner. A field that kept its own state would look
235
- // right until someone pressed Back.
236
- describe("ConfigureGenerationStep — the draft is the owner's", () => {
237
- it('reports edits to title, instructions, language and creativity', async () => {
238
- const { input } = renderStep(engineWithCeiling(4_000));
239
- expect(input()).toBeInTheDocument();
240
-
241
- fireEvent.change(screen.getByLabelText(translations.resourceTitle), {
242
- target: { value: 'Caspian Sea' },
243
- });
244
- expect(
245
- (screen.getByLabelText(translations.resourceTitle) as HTMLInputElement)
246
- .value,
247
- ).toBe('Caspian Sea');
248
-
249
- fireEvent.change(
250
- screen.getByLabelText(translations.additionalInstructions),
251
- { target: { value: 'hydrology only' } },
252
- );
253
- expect(
254
- (
255
- screen.getByLabelText(
256
- translations.additionalInstructions,
257
- ) as HTMLTextAreaElement
258
- ).value,
259
- ).toBe('hydrology only');
260
-
261
- // The label carries the live value — "Creativity (0.7)" — which is itself
262
- // the proof the slider is controlled: it can only update if the owner's
263
- // draft came back down.
264
- const slider = () =>
265
- screen.getByLabelText(
266
- new RegExp(`^${translations.creativity}`),
267
- ) as HTMLInputElement;
268
- fireEvent.change(slider(), { target: { value: '0.2' } });
269
- expect(slider().value).toBe('0.2');
270
- expect(screen.getByText(/Creativity \(0\.2\)/)).toBeInTheDocument();
271
- });
272
-
273
- it('lets the max-length field go empty while retyping', () => {
274
- // Clearing is a legitimate mid-edit state — you cannot retype a number
275
- // otherwise — so the field must accept '' and let submission clamp it.
276
- const { input } = renderStep(engineWithCeiling(4_000));
277
- fireEvent.change(input(), { target: { value: '' } });
278
- expect(input().value).toBe('');
279
- });
280
-
281
- it('reports a language change to the owner', () => {
282
- renderStep(engineWithCeiling(4_000));
283
- const select = () =>
284
- screen.getByLabelText(translations.language) as HTMLSelectElement;
285
- const other = Array.from(select().options)
286
- .map((o) => o.value)
287
- .find((v) => v !== select().value);
288
- fireEvent.change(select(), { target: { value: other } });
289
- expect(select().value).toBe(other);
290
- });
291
-
292
- it('carries the typed instructions into the submitted config, trimmed', () => {
293
- const { props } = renderStep(engineWithCeiling(4_000));
294
- fillRequired();
295
- fireEvent.change(
296
- screen.getByLabelText(translations.additionalInstructions),
297
- { target: { value: ' hydrology only ' } },
298
- );
299
- fireEvent.click(screen.getByText(new RegExp(translations.generate)));
300
-
301
- expect(props.onGenerate).toHaveBeenCalledTimes(1);
302
- expect(props.onGenerate.mock.calls[0]![0].prompt).toBe('hydrology only');
303
- });
304
-
305
- it('omits the prompt entirely when the field is blank', () => {
306
- // `prompt` is optional on the wire; sending "" would be a claim the user
307
- // never made, and the worker would prepend an empty instruction block.
308
- const { props } = renderStep(engineWithCeiling(4_000));
309
- fillRequired();
310
- fireEvent.click(screen.getByText(new RegExp(translations.generate)));
311
- expect(props.onGenerate.mock.calls[0]![0]).not.toHaveProperty('prompt');
312
- });
313
- });
314
-
315
- // ── The output format is a choice ───────────────────────────────────────────
316
- // The wire, the worker and the registry all carry the generatable types; this
317
- // control is where the user chooses among them.
318
-
319
- describe('ConfigureGenerationStep — the output format', () => {
320
- const formatSelect = () =>
321
- screen.getByLabelText(translations.outputFormat) as HTMLSelectElement;
322
-
323
- it('offers exactly the registry-generatable types, in registry order, by their registry labels', () => {
324
- // DERIVED from GENERATABLE_MEDIA_TYPES, never a literal list: promoting a
325
- // fourth row must light it up here for free, and a hand-written array
326
- // would silently lie the moment the registry moves.
327
- renderStep();
328
- const options = Array.from(formatSelect().options);
329
- expect(options.map((o) => o.value)).toEqual([...GENERATABLE_MEDIA_TYPES]);
330
- expect(options.map((o) => o.textContent)).toEqual(
331
- GENERATABLE_MEDIA_TYPES.map((t) => capabilitiesOf(t)!.label),
332
- );
333
- });
334
-
335
- it('defaults to markdown, and SENDS what it shows', () => {
336
- // The worker already defaults to markdown when the key is absent, so an
337
- // unsent field would produce the right artifact by accident. The point is
338
- // that the displayed value is the transmitted one.
339
- const { props } = renderStep();
340
- expect(formatSelect().value).toBe('text/markdown');
341
- fillRequired();
342
- fireEvent.click(screen.getByText(new RegExp(translations.generate)));
343
- expect(props.onGenerate.mock.calls[0]![0]).toMatchObject({
344
- outputMediaType: 'text/markdown',
345
- });
346
- });
347
-
348
- it('carries a chosen format into the submitted config', () => {
349
- const { props } = renderStep();
350
- fireEvent.change(screen.getByLabelText('Save location'), {
351
- target: { value: 'generated/out.pdf' },
352
- });
353
- fireEvent.change(formatSelect(), { target: { value: 'application/pdf' } });
354
- fireEvent.click(screen.getByText(new RegExp(translations.generate)));
355
- expect(props.onGenerate.mock.calls[0]![0]).toMatchObject({
356
- outputMediaType: 'application/pdf',
357
- });
358
- });
359
- });
360
-
361
- describe('ConfigureGenerationStep — the GUI refuses a format/extension mismatch', () => {
362
- const formatSelect = () =>
363
- screen.getByLabelText(translations.outputFormat) as HTMLSelectElement;
364
- const generateButton = () =>
365
- screen.getByText(new RegExp(translations.generate)).closest('button')!;
366
-
367
- it('blocks submission and explains, naming the extension the format expects', () => {
368
- // The worker is faithful and incurious — it will write a PDF to a .md
369
- // path and only log it — so this form is the ONLY refusal in the chain.
370
- const { props } = renderStep();
371
- fireEvent.change(screen.getByLabelText('Save location'), {
372
- target: { value: 'generated/out.md' },
373
- });
374
- fireEvent.change(formatSelect(), { target: { value: 'application/pdf' } });
375
-
376
- expect(generateButton()).toBeDisabled();
377
- expect(screen.getByText(/must end in \.pdf/)).toBeInTheDocument();
378
- fireEvent.click(generateButton());
379
- expect(props.onGenerate).not.toHaveBeenCalled();
380
- });
381
-
382
- it('clears when EITHER control is corrected', () => {
383
- const { props } = renderStep();
384
- fireEvent.change(screen.getByLabelText('Save location'), {
385
- target: { value: 'generated/out.md' },
386
- });
387
- fireEvent.change(formatSelect(), { target: { value: 'application/pdf' } });
388
- expect(generateButton()).toBeDisabled();
389
-
390
- // Fix the path…
391
- fireEvent.change(screen.getByLabelText('Save location'), {
392
- target: { value: 'generated/out.pdf' },
393
- });
394
- expect(generateButton()).not.toBeDisabled();
395
- expect(screen.queryByText(/must end in/)).toBeNull();
396
-
397
- // …or, from a fresh mismatch, fix the format instead.
398
- fireEvent.change(formatSelect(), { target: { value: 'text/plain' } });
399
- expect(generateButton()).toBeDisabled();
400
- fireEvent.change(formatSelect(), { target: { value: 'application/pdf' } });
401
- expect(generateButton()).not.toBeDisabled();
402
-
403
- fireEvent.click(generateButton());
404
- expect(props.onGenerate).toHaveBeenCalledTimes(1);
405
- });
406
-
407
- it('never greets an untouched form with a refusal — the default state is coherent', () => {
408
- // markdown + the placeholder's `.md` shape: a user who has typed nothing
409
- // must not be told they are wrong.
410
- renderStep();
411
- expect(screen.queryByText(/must end in/)).toBeNull();
412
- fillRequired(); // generated/out.md, markdown selected
413
- expect(generateButton()).not.toBeDisabled();
414
- });
415
-
416
- it('refuses an extensionless path, and accepts a differently-cased one', () => {
417
- // Both edges: the rule is "ends with the registry
418
- // extension", so no extension fails it; case is not a real mismatch.
419
- renderStep();
420
- fireEvent.change(screen.getByLabelText('Save location'), {
421
- target: { value: 'generated/notes' },
422
- });
423
- expect(generateButton()).toBeDisabled();
424
-
425
- fireEvent.change(screen.getByLabelText('Save location'), {
426
- target: { value: 'generated/NOTES.MD' },
427
- });
428
- expect(generateButton()).not.toBeDisabled();
429
- });
430
- });
431
-
432
- // The hint being steered by stays visible on the configure step: one quiet
433
- // line, display only.
434
- describe('ConfigureGenerationStep — the hint echo', () => {
435
- it('echoes a non-empty hint, and renders nothing without one', () => {
436
- const { container, rerender } = render(
437
- <ConfigureGenerationStep
438
- context={context}
439
- config={DRAFT}
440
- onConfigChange={vi.fn()}
441
- onBack={vi.fn()}
442
- onGenerate={vi.fn()}
443
- translations={translations}
444
- hintEcho={{
445
- label: 'Hint',
446
- value: 'the ancient city, not the modern province',
447
- }}
448
- />,
449
- );
450
- const echo = container.querySelector('.xynolog-wizard__hint-echo');
451
- expect(echo).not.toBeNull();
452
- expect(echo!.textContent).toContain(
453
- 'the ancient city, not the modern province',
454
- );
455
-
456
- rerender(
457
- <ConfigureGenerationStep
458
- context={context}
459
- config={DRAFT}
460
- onConfigChange={vi.fn()}
461
- onBack={vi.fn()}
462
- onGenerate={vi.fn()}
463
- translations={translations}
464
- />,
465
- );
466
- expect(container.querySelector('.xynolog-wizard__hint-echo')).toBeNull();
467
- });
468
- });
469
-
470
- describe('the Save location proposes a path and stops following once touched', () => {
471
- const path = () => screen.getByLabelText('Save location') as HTMLInputElement;
472
- const title = () => screen.getByLabelText('Title') as HTMLInputElement;
473
-
474
- it('opens PRE-FILLED beside the source, named for the title', () => {
475
- renderStep(undefined, 'research');
476
- expect(path().value).toBe('research/untitled.md');
477
- });
478
-
479
- it('proposes a bare filename when the source has no folder', () => {
480
- renderStep(undefined, '');
481
- expect(path().value).toBe('untitled.md');
482
- });
483
-
484
- it('FOLLOWS the title while untouched', () => {
485
- renderStep(undefined, 'research');
486
- fireEvent.change(title(), { target: { value: 'A New Name' } });
487
- expect(path().value).toBe('research/a-new-name.md');
488
- });
489
-
490
- it('FOLLOWS the format while untouched — extension included', () => {
491
- renderStep(undefined, 'research');
492
- fireEvent.change(screen.getByLabelText('Format'), {
493
- target: { value: 'application/pdf' },
494
- });
495
- expect(path().value).toBe('research/untitled.pdf');
496
- });
497
-
498
- it('STOPS following once the path is edited — the title then moves freely', () => {
499
- renderStep(undefined, 'research');
500
- fireEvent.change(path(), { target: { value: 'elsewhere/mine.md' } });
501
- fireEvent.change(title(), { target: { value: 'A New Name' } });
502
- expect(path().value).toBe('elsewhere/mine.md');
503
- });
504
-
505
- it('CLEARING the field un-touches it, restoring the proposal', () => {
506
- renderStep(undefined, 'research');
507
- fireEvent.change(path(), { target: { value: 'elsewhere/mine.md' } });
508
- fireEvent.change(path(), { target: { value: '' } });
509
- expect(path().value).toBe('research/untitled.md');
510
- });
511
-
512
- it('submits the PROPOSED path when the user never touched it', () => {
513
- const { props } = renderStep(undefined, 'research');
514
- fireEvent.click(screen.getByRole('button', { name: 'Generate' }));
515
- expect(props.onGenerate).toHaveBeenCalledWith(
516
- expect.objectContaining({ storageUri: 'file://research/untitled.md' }),
517
- );
518
- });
519
-
520
- it('a proposed path never trips the mismatch refusal — it carries the right extension', () => {
521
- const { props } = renderStep(undefined, 'research');
522
- fireEvent.change(screen.getByLabelText('Format'), {
523
- target: { value: 'application/pdf' },
524
- });
525
- fireEvent.click(screen.getByRole('button', { name: 'Generate' }));
526
- expect(props.onGenerate).toHaveBeenCalledWith(
527
- expect.objectContaining({ storageUri: 'file://research/untitled.pdf' }),
528
- );
529
- });
530
- });
531
-
532
- describe('temperature gating — the Creativity slider follows the model', () => {
533
- // claude-sonnet-5 refuses every non-default temperature with a 400 —
534
- // including the wizard's own 0.7 default — so a rejecting model must neither
535
- // show the control nor receive the field. Only an EXPLICIT false hides it:
536
- // absence of discovery means no claim, and the control stays.
537
- const rejectingEngine = (): EngineWithLimits => ({
538
- engine: { provider: 'anthropic', model: 'claude-sonnet-5' },
539
- jobs: [{ jobType: 'yield' }],
540
- limits: {
541
- contextTokens: 200_000,
542
- maxOutputTokens: 64_000,
543
- acceptsTemperature: false,
544
- },
545
- });
546
-
547
- it('hides the slider and OMITS temperature from the submission when the model rejects it', () => {
548
- const { props } = renderStep(rejectingEngine(), 'research');
549
-
550
- expect(screen.queryByLabelText(/Creativity/)).not.toBeInTheDocument();
551
-
552
- fireEvent.click(screen.getByRole('button', { name: 'Generate' }));
553
- expect(props.onGenerate).toHaveBeenCalledTimes(1);
554
- expect(
555
- 'temperature' in (props.onGenerate.mock.calls[0]![0] as object),
556
- ).toBe(false);
557
- });
558
-
559
- it('keeps the slider and sends temperature when discovery makes no claim about acceptance', () => {
560
- const { props } = renderStep(engineWithCeiling(64_000), 'research');
561
-
562
- expect(screen.getByLabelText(/Creativity/)).toBeInTheDocument();
563
-
564
- fireEvent.click(screen.getByRole('button', { name: 'Generate' }));
565
- expect(props.onGenerate).toHaveBeenCalledWith(
566
- expect.objectContaining({ temperature: 0.7 }),
567
- );
568
- });
569
-
570
- it('keeps the slider with no discovery at all — only an explicit false hides it', () => {
571
- renderStep(undefined, 'research');
572
- expect(screen.getByLabelText(/Creativity/)).toBeInTheDocument();
573
- });
574
- });
@@ -1,124 +0,0 @@
1
- /**
2
- * The search step is CONTROLLED — the wizard owns
3
- * `limit` and `useSemanticScoring` so stepping Back cannot discard them.
4
- *
5
- * That makes these tests about the contract rather than the widget: every edit
6
- * must reach `onConfigChange` (an uncontrolled field would appear to work and
7
- * silently revert on Back), and submit must send the CURRENT config rather than
8
- * a stale copy.
9
- */
10
- import { describe, it, expect, vi } from 'vitest';
11
- import { render, screen } from '@testing-library/react';
12
- import userEvent from '@testing-library/user-event';
13
- import '@testing-library/jest-dom';
14
- import { ConfigureSearchStep, type SearchConfig } from '../ConfigureSearchStep';
15
-
16
- const T = {
17
- maxResults: 'Max Results',
18
- semanticScoring: 'Semantic Scoring',
19
- semanticScoringHelp: 'Use AI to score results by semantic relevance',
20
- back: 'Back',
21
- search: 'Search',
22
- searching: 'Searching…',
23
- searchFailed: 'Search failed',
24
- };
25
-
26
- const CONFIG: SearchConfig = { limit: 10, useSemanticScoring: true };
27
-
28
- function renderStep(config: SearchConfig = CONFIG) {
29
- const onConfigChange = vi.fn();
30
- const onSearch = vi.fn();
31
- const onBack = vi.fn();
32
- render(
33
- <ConfigureSearchStep
34
- config={config}
35
- onConfigChange={onConfigChange}
36
- onBack={onBack}
37
- onSearch={onSearch}
38
- translations={T}
39
- />,
40
- );
41
- return { onConfigChange, onSearch, onBack };
42
- }
43
-
44
- describe('ConfigureSearchStep', () => {
45
- it('reports a new result limit to the owner rather than keeping it', async () => {
46
- const { onConfigChange } = renderStep();
47
- await userEvent.selectOptions(screen.getByLabelText(T.maxResults), '20');
48
- expect(onConfigChange).toHaveBeenCalledWith({
49
- limit: 20,
50
- useSemanticScoring: true,
51
- });
52
- });
53
-
54
- it('reports the semantic-scoring toggle the same way', async () => {
55
- const { onConfigChange } = renderStep();
56
- await userEvent.click(screen.getByLabelText(new RegExp(T.semanticScoring)));
57
- expect(onConfigChange).toHaveBeenCalledWith({
58
- limit: 10,
59
- useSemanticScoring: false,
60
- });
61
- });
62
-
63
- it('echoes the hint being steered by, and stays silent without one', () => {
64
- // The thing the hint steers goes invisible behind the step transition —
65
- // one quiet line keeps it visible and advertises that the hint did something.
66
- const { container, rerender } = render(
67
- <ConfigureSearchStep
68
- config={CONFIG}
69
- onConfigChange={vi.fn()}
70
- onBack={vi.fn()}
71
- onSearch={vi.fn()}
72
- translations={T}
73
- hintEcho={{
74
- label: 'Hint',
75
- value: 'the ancient city, not the modern province',
76
- }}
77
- />,
78
- );
79
- const echo = container.querySelector('.xynolog-wizard__hint-echo');
80
- expect(echo).not.toBeNull();
81
- expect(echo!.textContent).toContain(
82
- 'the ancient city, not the modern province',
83
- );
84
-
85
- rerender(
86
- <ConfigureSearchStep
87
- config={CONFIG}
88
- onConfigChange={vi.fn()}
89
- onBack={vi.fn()}
90
- onSearch={vi.fn()}
91
- translations={T}
92
- />,
93
- );
94
- expect(container.querySelector('.xynolog-wizard__hint-echo')).toBeNull();
95
- });
96
-
97
- it('submits whatever the owner currently holds, not a default', async () => {
98
- // The point of controlled state: a step that kept its own copy could submit
99
- // something the wizard never saw.
100
- const { onSearch } = renderStep({ limit: 5, useSemanticScoring: false });
101
- await userEvent.click(screen.getByRole('button', { name: T.search }));
102
- expect(onSearch).toHaveBeenCalledWith({
103
- limit: 5,
104
- useSemanticScoring: false,
105
- });
106
- });
107
-
108
- it("renders the owner's values, so Back-then-forward shows them again", () => {
109
- renderStep({ limit: 20, useSemanticScoring: false });
110
- expect(
111
- (screen.getByLabelText(T.maxResults) as HTMLSelectElement).value,
112
- ).toBe('20');
113
- expect(
114
- (screen.getByLabelText(new RegExp(T.semanticScoring)) as HTMLInputElement)
115
- .checked,
116
- ).toBe(false);
117
- });
118
-
119
- it('retreats when Back is pressed', async () => {
120
- const { onBack } = renderStep();
121
- await userEvent.click(screen.getByRole('button', { name: /Back/ }));
122
- expect(onBack).toHaveBeenCalledTimes(1);
123
- });
124
- });