@terreno/admin-frontend 57.20.0 → 57.21.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/AdminFilterDrawer.d.ts.map +1 -1
  3. package/dist/AdminFilterDrawer.js.map +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/types.d.ts +2 -0
  8. package/dist/types.d.ts.map +1 -1
  9. package/dist/types.js.map +1 -1
  10. package/package.json +7 -3
  11. package/src/AdminBreadcrumbs.test.tsx +1 -1
  12. package/src/AdminFieldRenderer.test.tsx +2 -1
  13. package/src/AdminFilterDrawer.tsx +1 -2
  14. package/src/AdminHome.test.tsx +2 -1
  15. package/src/AdminModelTable.test.tsx +16 -12
  16. package/src/AdminModelTable.windowed.test.tsx +11 -5
  17. package/src/AdminPrimitiveArrayField.test.tsx +3 -3
  18. package/src/AdminProvider.test.tsx +11 -6
  19. package/src/AdminRolesList.test.tsx +22 -13
  20. package/src/AdminScreenPage.test.tsx +1 -1
  21. package/src/AdminScreenRouter.test.tsx +15 -5
  22. package/src/AdminScriptList.test.tsx +9 -2
  23. package/src/AdminShell.test.tsx +1 -1
  24. package/src/AdminVersionConfig.test.tsx +4 -4
  25. package/src/AnnouncementOverviewScreenWidget.test.tsx +6 -1
  26. package/src/CheckboxListEditor.test.tsx +11 -9
  27. package/src/ConfigurationScreen.test.tsx +2 -2
  28. package/src/adminRequest.test.ts +3 -3
  29. package/src/adminWindowedTable.test.ts +4 -2
  30. package/src/comms/CommsDashboardScreen.test.tsx +5 -5
  31. package/src/comms/CommsMessageDetail.test.tsx +1 -1
  32. package/src/index.tsx +2 -0
  33. package/src/isolated/AdminFieldRenderer.isolated.tsx +11 -6
  34. package/src/isolated/AdminFilterDrawer.isolated.tsx +8 -6
  35. package/src/isolated/AdminFilterDrawerMobile.isolated.tsx +3 -1
  36. package/src/isolated/AdminHomeWidgets.isolated.tsx +2 -0
  37. package/src/isolated/AdminNestedArrayField.isolated.tsx +10 -9
  38. package/src/isolated/AdminObjectPicker.isolated.tsx +9 -10
  39. package/src/isolated/AiPromptsListScreen.isolated.tsx +1 -1
  40. package/src/isolated/DocumentStorageBrowser.isolated.tsx +16 -8
  41. package/src/isolated/RecentActivityWidget.isolated.tsx +2 -0
  42. package/src/isolated/adminWidgets.isolated.tsx +46 -6
  43. package/src/isolated/aiObservabilityScreens.isolated.tsx +18 -9
  44. package/src/isolated/generateConsentHistoryPdf.isolated.ts +30 -10
  45. package/src/isolated/generateConsentPdfsMobile.isolated.ts +24 -3
  46. package/src/isolated/hooks.isolated.tsx +84 -60
  47. package/src/isolated/rpcDualRun.isolated.tsx +9 -2
  48. package/src/jobs/JobsDashboardScreen.test.tsx +3 -3
  49. package/src/jobs/JobsHomeWidget.test.tsx +1 -1
  50. package/src/jobs/JobsJobDetail.test.tsx +1 -1
  51. package/src/orgs/OrgManagementScreens.test.tsx +1 -1
  52. package/src/orgs/adminModelEndpoints.test.ts +1 -1
  53. package/src/testing/useAdminApiDouble.ts +2 -1
  54. package/src/types.ts +2 -0
  55. package/src/useAdminRpc.test.tsx +3 -3
  56. package/src/widgets/AIRequestsScreenWidget.test.tsx +20 -3
  57. package/src/widgets/ModelsGridWidget.test.tsx +25 -5
  58. package/src/widgets/aiObservability/datasets/AiDatasetDetailView.test.tsx +4 -2
  59. package/src/widgets/aiObservability/datasets/datasetTypes.test.ts +0 -1
  60. package/src/widgets/aiObservability/evaluators/AiEvaluatorPanels.test.tsx +89 -23
  61. package/src/widgets/aiObservability/experiments/AiExperimentNewView.test.tsx +4 -0
  62. package/src/widgets/aiObservability/shell/ObservabilityTable.test.tsx +7 -1
  63. package/src/widgets/builtInFieldWidgets.test.tsx +16 -3
@@ -6,7 +6,9 @@ import React from "react";
6
6
  import {renderWithTheme} from "../../../../../ui/src/test-utils";
7
7
  import {
8
8
  AiEvaluatorDetailView,
9
+ type AiEvaluatorDetailViewProps,
9
10
  AiEvaluatorNewView,
11
+ type AiEvaluatorNewViewProps,
10
12
  defaultEvaluatorRunModes,
11
13
  initialNewEvaluatorDimensions,
12
14
  } from "./AiEvaluatorPanels";
@@ -24,6 +26,7 @@ describe("AiEvaluatorNewView schema mismatch", () => {
24
26
  <AiEvaluatorNewView
25
27
  assertionConstraint="exists"
26
28
  assertionPath="output"
29
+ description=""
27
30
  dimensions={[{dataType: "boolean", key: "correct", required: true}]}
28
31
  instructions=""
29
32
  isCreating={false}
@@ -56,6 +59,7 @@ describe("AiEvaluatorNewView helper text", () => {
56
59
  <AiEvaluatorNewView
57
60
  assertionConstraint="exists"
58
61
  assertionPath=""
62
+ description=""
59
63
  dimensions={[{dataType: "boolean", key: "pass", required: true}]}
60
64
  instructions=""
61
65
  isCreating={false}
@@ -101,6 +105,7 @@ describe("AiEvaluatorNewView helper text", () => {
101
105
  <AiEvaluatorNewView
102
106
  assertionConstraint="exists"
103
107
  assertionPath="output.text"
108
+ description=""
104
109
  dimensions={[{dataType: "boolean", key: "pass", required: true}]}
105
110
  instructions=""
106
111
  isCreating={false}
@@ -135,6 +140,7 @@ describe("AiEvaluatorNewView panels", () => {
135
140
  <AiEvaluatorNewView
136
141
  assertionConstraint="exists"
137
142
  assertionPath=""
143
+ description=""
138
144
  dimensions={[{dataType: "boolean", key: "pass", required: true}]}
139
145
  instructions="Rate quality"
140
146
  isCreating={false}
@@ -164,6 +170,7 @@ describe("AiEvaluatorNewView panels", () => {
164
170
  <AiEvaluatorNewView
165
171
  assertionConstraint="exists"
166
172
  assertionPath="output.text"
173
+ description=""
167
174
  dimensions={[{dataType: "boolean", key: "pass", required: true}]}
168
175
  instructions=""
169
176
  isCreating={false}
@@ -189,17 +196,28 @@ describe("AiEvaluatorNewView panels", () => {
189
196
  });
190
197
 
191
198
  it("wires new-evaluator controls for dimensions, targets, and run modes", async () => {
192
- const onTypeChange = mock(() => undefined);
193
- const onAddDimension = mock(() => undefined);
194
- const onRemoveDimension = mock(() => undefined);
195
- const onLiveSampleRateChange = mock(() => undefined);
196
- const onDescriptionChange = mock(() => undefined);
197
- const onCreate = mock(() => undefined);
199
+ const onTypeChange = mock<NonNullable<AiEvaluatorNewViewProps["onTypeChange"]>>(
200
+ () => undefined
201
+ );
202
+ const onAddDimension = mock<NonNullable<AiEvaluatorNewViewProps["onAddDimension"]>>(
203
+ () => undefined
204
+ );
205
+ const onRemoveDimension = mock<NonNullable<AiEvaluatorNewViewProps["onRemoveDimension"]>>(
206
+ () => undefined
207
+ );
208
+ const onLiveSampleRateChange = mock<
209
+ NonNullable<AiEvaluatorNewViewProps["onLiveSampleRateChange"]>
210
+ >(() => undefined);
211
+ const onDescriptionChange = mock<NonNullable<AiEvaluatorNewViewProps["onDescriptionChange"]>>(
212
+ () => undefined
213
+ );
214
+ const onCreate = mock<NonNullable<AiEvaluatorNewViewProps["onCreate"]>>(() => undefined);
198
215
  const {getByTestId, getAllByText, getByText} = renderWithTheme(
199
216
  <AiEvaluatorNewView
200
217
  assertionConstraint="exists"
201
218
  assertionPath="output"
202
219
  createError="Name taken"
220
+ description=""
203
221
  dimensions={[
204
222
  {dataType: "boolean", key: "pass", required: true},
205
223
  {dataType: "numeric", key: "score", range: "0-1", required: false},
@@ -245,10 +263,13 @@ describe("AiEvaluatorNewView panels", () => {
245
263
 
246
264
  describe("AiEvaluatorDetailView", () => {
247
265
  it("renders dimensions, llm-judge config, and 30-day usage table", () => {
248
- const onOpenPrompt = mock(() => undefined);
266
+ const onOpenPrompt = mock<NonNullable<AiEvaluatorDetailViewProps["onOpenPrompt"]>>(
267
+ () => undefined
268
+ );
249
269
  const {getByTestId, getByText} = renderWithTheme(
250
270
  <AiEvaluatorDetailView
251
271
  evaluator={{
272
+ confidenceAlertBelow: 0,
252
273
  dimensions: [{dataType: "boolean", key: "correct", required: true}],
253
274
  id: "eval-1",
254
275
  judgePromptName: "judge",
@@ -260,7 +281,9 @@ describe("AiEvaluatorDetailView", () => {
260
281
  judgeOutputSchema={{properties: {correct: {type: "boolean"}}}}
261
282
  onOpenPrompt={onOpenPrompt}
262
283
  routeBase="/admin"
263
- usageRows={[{costUsd: 1.2, experimentName: "compare", runs: 3}]}
284
+ usageRows={[
285
+ {costUsd: 1.2, experimentId: "exp-compare", experimentName: "compare", runs: 3},
286
+ ]}
264
287
  />
265
288
  );
266
289
  expect(getByTestId("ai-evaluator-detail")).toBeTruthy();
@@ -285,6 +308,7 @@ describe("AiEvaluatorDetailView", () => {
285
308
  const human = renderWithTheme(
286
309
  <AiEvaluatorDetailView
287
310
  evaluator={{
311
+ confidenceAlertBelow: 0,
288
312
  dimensions: [{dataType: "boolean", key: "pass", required: true}],
289
313
  id: "eval-2",
290
314
  instructions: "Rate quality",
@@ -307,8 +331,8 @@ describe("AiEvaluatorDetailView", () => {
307
331
  const jsonAssert = renderWithTheme(
308
332
  <AiEvaluatorDetailView
309
333
  evaluator={{
310
- assertionConstraint: "exists",
311
- assertionPath: "output.text",
334
+ assertion: {constraint: "exists", path: "output.text"},
335
+ confidenceAlertBelow: 0,
312
336
  dimensions: [{dataType: "boolean", key: "pass", required: true}],
313
337
  id: "eval-3",
314
338
  name: "assert",
@@ -329,6 +353,7 @@ describe("AiEvaluatorDetailView", () => {
329
353
  const noPrompt = renderWithTheme(
330
354
  <AiEvaluatorDetailView
331
355
  evaluator={{
356
+ confidenceAlertBelow: 0,
332
357
  dimensions: [{dataType: "boolean", key: "correct", required: true}],
333
358
  id: "eval-4",
334
359
  name: "quality",
@@ -347,6 +372,7 @@ describe("AiEvaluatorDetailView", () => {
347
372
  const withLink = renderWithTheme(
348
373
  <AiEvaluatorDetailView
349
374
  evaluator={{
375
+ confidenceAlertBelow: 0,
350
376
  dimensions: [{dataType: "boolean", key: "correct", required: true}],
351
377
  id: "eval-5",
352
378
  judgePromptName: "judge",
@@ -363,10 +389,13 @@ describe("AiEvaluatorDetailView", () => {
363
389
  });
364
390
 
365
391
  it("opens judge prompt via onOpenPrompt and shows schema match", async () => {
366
- const onOpenPrompt = mock(() => undefined);
392
+ const onOpenPrompt = mock<NonNullable<AiEvaluatorDetailViewProps["onOpenPrompt"]>>(
393
+ () => undefined
394
+ );
367
395
  const {getByText} = renderWithTheme(
368
396
  <AiEvaluatorDetailView
369
397
  evaluator={{
398
+ confidenceAlertBelow: 0,
370
399
  dimensions: [{dataType: "boolean", key: "correct", required: true}],
371
400
  id: "eval-1",
372
401
  judgePromptName: "judge",
@@ -378,7 +407,9 @@ describe("AiEvaluatorDetailView", () => {
378
407
  judgeOutputSchema={{properties: {correct: {type: "boolean"}}}}
379
408
  onOpenPrompt={onOpenPrompt}
380
409
  routeBase="/admin"
381
- usageRows={[{costUsd: undefined, experimentName: "compare", runs: 1}]}
410
+ usageRows={[
411
+ {costUsd: undefined, experimentId: "exp-compare", experimentName: "compare", runs: 1},
412
+ ]}
382
413
  />
383
414
  );
384
415
  await act(async () => {
@@ -393,6 +424,7 @@ describe("AiEvaluatorDetailView", () => {
393
424
  const mismatch = renderWithTheme(
394
425
  <AiEvaluatorDetailView
395
426
  evaluator={{
427
+ confidenceAlertBelow: 0,
396
428
  dimensions: [{dataType: "boolean", key: "correct", required: true}],
397
429
  id: "eval-6",
398
430
  judgePromptName: "judge",
@@ -411,6 +443,7 @@ describe("AiEvaluatorDetailView", () => {
411
443
  const human = renderWithTheme(
412
444
  <AiEvaluatorDetailView
413
445
  evaluator={{
446
+ confidenceAlertBelow: 0,
414
447
  dimensions: [{dataType: "boolean", key: "pass", required: true}],
415
448
  id: "eval-7",
416
449
  name: "human",
@@ -428,12 +461,17 @@ describe("AiEvaluatorDetailView", () => {
428
461
 
429
462
  describe("AiEvaluatorNewView dimension editing", () => {
430
463
  it("wires dimension key, type, range, and remove handlers", async () => {
431
- const onDimensionChange = mock(() => undefined);
432
- const onRemoveDimension = mock(() => undefined);
464
+ const onDimensionChange = mock<NonNullable<AiEvaluatorNewViewProps["onDimensionChange"]>>(
465
+ () => undefined
466
+ );
467
+ const onRemoveDimension = mock<NonNullable<AiEvaluatorNewViewProps["onRemoveDimension"]>>(
468
+ () => undefined
469
+ );
433
470
  const {getAllByDisplayValue, getAllByText} = renderWithTheme(
434
471
  <AiEvaluatorNewView
435
472
  assertionConstraint="exists"
436
473
  assertionPath="output"
474
+ description=""
437
475
  dimensions={[
438
476
  {dataType: "boolean", key: "pass", required: true},
439
477
  {dataType: "boolean", key: "extra", required: false},
@@ -471,15 +509,26 @@ describe("AiEvaluatorNewView dimension editing", () => {
471
509
  });
472
510
 
473
511
  it("wires assertion, instructions, judge prompt, and range fields", async () => {
474
- const onAssertionPathChange = mock(() => undefined);
475
- const onAssertionConstraintChange = mock(() => undefined);
476
- const onInstructionsChange = mock(() => undefined);
477
- const onJudgePromptNameChange = mock(() => undefined);
478
- const onDimensionChange = mock(() => undefined);
512
+ const onAssertionPathChange = mock<
513
+ NonNullable<AiEvaluatorNewViewProps["onAssertionPathChange"]>
514
+ >(() => undefined);
515
+ const onAssertionConstraintChange = mock<
516
+ NonNullable<AiEvaluatorNewViewProps["onAssertionConstraintChange"]>
517
+ >(() => undefined);
518
+ const onInstructionsChange = mock<NonNullable<AiEvaluatorNewViewProps["onInstructionsChange"]>>(
519
+ () => undefined
520
+ );
521
+ const onJudgePromptNameChange = mock<
522
+ NonNullable<AiEvaluatorNewViewProps["onJudgePromptNameChange"]>
523
+ >(() => undefined);
524
+ const onDimensionChange = mock<NonNullable<AiEvaluatorNewViewProps["onDimensionChange"]>>(
525
+ () => undefined
526
+ );
479
527
  const llmJudge = renderWithTheme(
480
528
  <AiEvaluatorNewView
481
529
  assertionConstraint="exists"
482
530
  assertionPath="output"
531
+ description=""
483
532
  dimensions={[{dataType: "boolean", key: "correct", required: false}]}
484
533
  instructions=""
485
534
  isCreating={false}
@@ -513,6 +562,7 @@ describe("AiEvaluatorNewView dimension editing", () => {
513
562
  <AiEvaluatorNewView
514
563
  assertionConstraint="exists"
515
564
  assertionPath="output"
565
+ description=""
516
566
  dimensions={[{dataType: "boolean", key: "pass", required: true}]}
517
567
  instructions="Rate quality"
518
568
  isCreating={false}
@@ -541,6 +591,7 @@ describe("AiEvaluatorNewView dimension editing", () => {
541
591
  <AiEvaluatorNewView
542
592
  assertionConstraint="exists"
543
593
  assertionPath="output.text"
594
+ description=""
544
595
  dimensions={[{dataType: "numeric", key: "score", range: "0-1", required: true}]}
545
596
  instructions=""
546
597
  isCreating={false}
@@ -573,13 +624,20 @@ describe("AiEvaluatorNewView dimension editing", () => {
573
624
 
574
625
  describe("AiEvaluatorNewView type and live sample controls", () => {
575
626
  it("selects each dimension data type and ignores invalid live sample input", async () => {
576
- const onTypeChange = mock(() => undefined);
577
- const onDimensionChange = mock(() => undefined);
578
- const onLiveSampleRateChange = mock(() => undefined);
627
+ const onTypeChange = mock<NonNullable<AiEvaluatorNewViewProps["onTypeChange"]>>(
628
+ () => undefined
629
+ );
630
+ const onDimensionChange = mock<NonNullable<AiEvaluatorNewViewProps["onDimensionChange"]>>(
631
+ () => undefined
632
+ );
633
+ const onLiveSampleRateChange = mock<
634
+ NonNullable<AiEvaluatorNewViewProps["onLiveSampleRateChange"]>
635
+ >(() => undefined);
579
636
  const {getAllByText, getByTestId} = renderWithTheme(
580
637
  <AiEvaluatorNewView
581
638
  assertionConstraint="exists"
582
639
  assertionPath="output"
640
+ description=""
583
641
  dimensions={[{dataType: "boolean", key: "pass", required: true}]}
584
642
  instructions=""
585
643
  isCreating={false}
@@ -623,6 +681,7 @@ describe("AiEvaluatorNewView type and live sample controls", () => {
623
681
  <AiEvaluatorNewView
624
682
  assertionConstraint="exists"
625
683
  assertionPath="output"
684
+ description=""
626
685
  dimensions={[{dataType: "boolean", key: "pass", required: true}]}
627
686
  instructions=""
628
687
  isCreating={false}
@@ -654,6 +713,7 @@ describe("AiEvaluatorNewView type and live sample controls", () => {
654
713
  <AiEvaluatorNewView
655
714
  assertionConstraint="exists"
656
715
  assertionPath="output"
716
+ description=""
657
717
  dimensions={[{dataType: "boolean", key: "pass", required: true}]}
658
718
  instructions=""
659
719
  isCreating={false}
@@ -681,6 +741,7 @@ describe("AiEvaluatorNewView type and live sample controls", () => {
681
741
  <AiEvaluatorNewView
682
742
  assertionConstraint="exists"
683
743
  assertionPath="output.text"
744
+ description=""
684
745
  dimensions={[{dataType: "boolean", key: "pass", required: true}]}
685
746
  instructions=""
686
747
  isCreating={false}
@@ -710,11 +771,14 @@ describe("AiEvaluatorNewView type and live sample controls", () => {
710
771
 
711
772
  describe("AiEvaluatorNewView score fields", () => {
712
773
  it("hides extra controls for boolean and edits numeric and categorical scores", async () => {
713
- const onDimensionChange = mock(() => undefined);
774
+ const onDimensionChange = mock<NonNullable<AiEvaluatorNewViewProps["onDimensionChange"]>>(
775
+ () => undefined
776
+ );
714
777
  const view = renderWithTheme(
715
778
  <AiEvaluatorNewView
716
779
  assertionConstraint="exists"
717
780
  assertionPath="output"
781
+ description=""
718
782
  dimensions={[
719
783
  {dataType: "boolean", key: "pass", required: true},
720
784
  {dataType: "numeric", key: "score", range: "0-1", required: true},
@@ -761,6 +825,7 @@ describe("AiEvaluatorNewView score fields", () => {
761
825
  <AiEvaluatorNewView
762
826
  assertionConstraint="exists"
763
827
  assertionPath="output"
828
+ description=""
764
829
  dimensions={dimensions}
765
830
  instructions=""
766
831
  isCreating={false}
@@ -789,6 +854,7 @@ describe("AiEvaluatorNewView score fields", () => {
789
854
  <AiEvaluatorNewView
790
855
  assertionConstraint="exists"
791
856
  assertionPath="output"
857
+ description=""
792
858
  dimensions={[{dataType: "numeric", key: "score", range: "0-1", required: true}]}
793
859
  instructions=""
794
860
  isCreating={false}
@@ -31,6 +31,10 @@ const promptDetail: PromptDetail = {
31
31
  {label: "production", version: 1},
32
32
  ],
33
33
  name: "summarize",
34
+ relationships: {
35
+ experiments: {items: [], limit: 20, total: 0},
36
+ traces: {items: [], limit: 20, total: 0},
37
+ },
34
38
  tags: [],
35
39
  versions: [
36
40
  {sensitive: false, template: "v1", type: "chat", variables: [], version: 1},
@@ -27,7 +27,13 @@ describe("ObservabilityTable", () => {
27
27
  {minWidth: 110, title: "Trace"},
28
28
  ]}
29
29
  rows={[
30
- {cells: [longInput, <Button key="open" size="sm" text="Open trace" />], key: "item-1"},
30
+ {
31
+ cells: [
32
+ longInput,
33
+ <Button key="open" onClick={() => undefined} size="sm" text="Open trace" />,
34
+ ],
35
+ key: "item-1",
36
+ },
31
37
  {cells: ["short", "—"], key: "item-2"},
32
38
  ]}
33
39
  testID="observability-table"
@@ -6,6 +6,7 @@ import {assert} from "chai";
6
6
  import React from "react";
7
7
  import type {ReactTestInstance} from "react-test-renderer";
8
8
  import {renderWithTheme} from "../../../ui/src/test-utils";
9
+ import type {AdminApi} from "../types";
9
10
  import {
10
11
  CheckboxListFieldWidget,
11
12
  LocaleContentFieldWidget,
@@ -15,12 +16,15 @@ import {
15
16
  } from "./builtInFieldWidgets";
16
17
 
17
18
  const fieldConfig = {description: "Helper copy", required: false, type: "string"};
19
+ // The built-in field widgets never call the deprecated RTK `api`.
20
+ const api = {} as AdminApi;
18
21
 
19
22
  describe("builtInFieldWidgets", () => {
20
23
  it("renders markdown and textarea widgets with labels and values", async () => {
21
- const onChange = mock((_value: string) => undefined);
24
+ const onChange = mock((_value: unknown) => undefined);
22
25
  const markdown = renderWithTheme(
23
26
  <MarkdownFieldWidget
27
+ api={api}
24
28
  fieldConfig={fieldConfig}
25
29
  fieldKey="bodyMarkdown"
26
30
  onChange={onChange}
@@ -34,6 +38,7 @@ describe("builtInFieldWidgets", () => {
34
38
 
35
39
  const textarea = renderWithTheme(
36
40
  <TextareaFieldWidget
41
+ api={api}
37
42
  fieldConfig={fieldConfig}
38
43
  fieldKey="notes"
39
44
  onChange={onChange}
@@ -46,6 +51,7 @@ describe("builtInFieldWidgets", () => {
46
51
  it("disables markdown and textarea widgets in read-only mode", async () => {
47
52
  const markdown = renderWithTheme(
48
53
  <MarkdownFieldWidget
54
+ api={api}
49
55
  fieldConfig={fieldConfig}
50
56
  fieldKey="bodyMarkdown"
51
57
  onChange={() => {}}
@@ -61,6 +67,7 @@ describe("builtInFieldWidgets", () => {
61
67
 
62
68
  const textarea = renderWithTheme(
63
69
  <TextareaFieldWidget
70
+ api={api}
64
71
  fieldConfig={fieldConfig}
65
72
  fieldKey="notes"
66
73
  onChange={() => {}}
@@ -76,6 +83,7 @@ describe("builtInFieldWidgets", () => {
76
83
  const onChange = mock((_value: unknown) => undefined);
77
84
  const editable = renderWithTheme(
78
85
  <CheckboxListFieldWidget
86
+ api={api}
79
87
  fieldConfig={fieldConfig}
80
88
  fieldKey="checkboxes"
81
89
  onChange={onChange}
@@ -86,6 +94,7 @@ describe("builtInFieldWidgets", () => {
86
94
 
87
95
  const readOnly = renderWithTheme(
88
96
  <CheckboxListFieldWidget
97
+ api={api}
89
98
  fieldConfig={fieldConfig}
90
99
  fieldKey="checkboxes"
91
100
  onChange={onChange}
@@ -99,9 +108,10 @@ describe("builtInFieldWidgets", () => {
99
108
  });
100
109
 
101
110
  it("renders locale content editor and read-only JSON fallback", () => {
102
- const onChange = mock((_value: Record<string, string>) => undefined);
111
+ const onChange = mock((_value: unknown) => undefined);
103
112
  const editable = renderWithTheme(
104
113
  <LocaleContentFieldWidget
114
+ api={api}
105
115
  fieldConfig={fieldConfig}
106
116
  fieldKey="content"
107
117
  onChange={onChange}
@@ -112,6 +122,7 @@ describe("builtInFieldWidgets", () => {
112
122
 
113
123
  const readOnly = renderWithTheme(
114
124
  <LocaleContentFieldWidget
125
+ api={api}
115
126
  fieldConfig={fieldConfig}
116
127
  fieldKey="content"
117
128
  onChange={onChange}
@@ -124,9 +135,10 @@ describe("builtInFieldWidgets", () => {
124
135
  });
125
136
 
126
137
  it("enables locale default select only when parent content has locales", () => {
127
- const onChange = mock((_value: string) => undefined);
138
+ const onChange = mock((_value: unknown) => undefined);
128
139
  const {UNSAFE_root, getByText} = renderWithTheme(
129
140
  <LocaleDefaultFieldWidget
141
+ api={api}
130
142
  fieldConfig={fieldConfig}
131
143
  fieldKey="defaultLocale"
132
144
  onChange={onChange}
@@ -142,6 +154,7 @@ describe("builtInFieldWidgets", () => {
142
154
 
143
155
  const withLocales = renderWithTheme(
144
156
  <LocaleDefaultFieldWidget
157
+ api={api}
145
158
  fieldConfig={fieldConfig}
146
159
  fieldKey="defaultLocale"
147
160
  onChange={onChange}