@finos/legend-application-studio 26.1.8 → 26.1.9

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 (108) hide show
  1. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.d.ts.map +1 -1
  2. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +2 -2
  3. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
  4. package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.d.ts +15 -2
  5. package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.d.ts.map +1 -1
  6. package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.js +46 -5
  7. package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.js.map +1 -1
  8. package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.d.ts.map +1 -1
  9. package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.js +18 -3
  10. package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.js.map +1 -1
  11. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_NewSchemaSetDriver.d.ts.map +1 -1
  12. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_NewSchemaSetDriver.js +2 -2
  13. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_NewSchemaSetDriver.js.map +1 -1
  14. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.d.ts.map +1 -1
  15. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js +0 -3
  16. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js.map +1 -1
  17. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.d.ts.map +1 -1
  18. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js +36 -72
  19. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js.map +1 -1
  20. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.d.ts +5 -0
  21. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.d.ts.map +1 -1
  22. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js +53 -8
  23. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
  24. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.d.ts.map +1 -1
  25. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.js +3 -1
  26. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.js.map +1 -1
  27. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.d.ts.map +1 -1
  28. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js +7 -3
  29. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js.map +1 -1
  30. package/lib/components/editor/editor-group/testable/TestableSharedComponents.js +1 -1
  31. package/lib/components/editor/editor-group/testable/TestableSharedComponents.js.map +1 -1
  32. package/lib/index.css +2 -2
  33. package/lib/index.css.map +1 -1
  34. package/lib/package.json +3 -3
  35. package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.d.ts +22 -1
  36. package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.d.ts.map +1 -1
  37. package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.js +56 -5
  38. package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.js.map +1 -1
  39. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts +12 -12
  40. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -1
  41. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +113 -61
  42. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
  43. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.d.ts +4 -2
  44. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.d.ts.map +1 -1
  45. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js +23 -9
  46. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js.map +1 -1
  47. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts +5 -2
  48. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts.map +1 -1
  49. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +23 -16
  50. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
  51. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts +3 -2
  52. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts.map +1 -1
  53. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js +11 -7
  54. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js.map +1 -1
  55. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts +3 -2
  56. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts.map +1 -1
  57. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js +29 -8
  58. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js.map +1 -1
  59. package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.d.ts +2 -2
  60. package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.d.ts.map +1 -1
  61. package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.js +8 -6
  62. package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.js.map +1 -1
  63. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts +14 -2
  64. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts.map +1 -1
  65. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js +75 -5
  66. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js.map +1 -1
  67. package/lib/stores/editor/utils/MockDataUtils.d.ts +4 -1
  68. package/lib/stores/editor/utils/MockDataUtils.d.ts.map +1 -1
  69. package/lib/stores/editor/utils/MockDataUtils.js +70 -2
  70. package/lib/stores/editor/utils/MockDataUtils.js.map +1 -1
  71. package/lib/stores/editor/utils/TestableUtils.d.ts +1 -2
  72. package/lib/stores/editor/utils/TestableUtils.d.ts.map +1 -1
  73. package/lib/stores/editor/utils/TestableUtils.js +4 -13
  74. package/lib/stores/editor/utils/TestableUtils.js.map +1 -1
  75. package/lib/stores/graph-modifier/DSL_Data_GraphModifierHelper.d.ts +6 -2
  76. package/lib/stores/graph-modifier/DSL_Data_GraphModifierHelper.d.ts.map +1 -1
  77. package/lib/stores/graph-modifier/DSL_Data_GraphModifierHelper.js +23 -4
  78. package/lib/stores/graph-modifier/DSL_Data_GraphModifierHelper.js.map +1 -1
  79. package/lib/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.js +1 -1
  80. package/lib/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.js.map +1 -1
  81. package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.d.ts +1 -0
  82. package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.d.ts.map +1 -1
  83. package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.js +3 -0
  84. package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.js.map +1 -1
  85. package/package.json +13 -13
  86. package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +13 -0
  87. package/src/components/editor/editor-group/data-editor/EmbeddedDataEditor.tsx +129 -3
  88. package/src/components/editor/editor-group/data-editor/RelationalCSVDataEditor.tsx +65 -0
  89. package/src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_NewSchemaSetDriver.tsx +6 -3
  90. package/src/components/editor/editor-group/mapping-editor/MappingEditor.tsx +0 -6
  91. package/src/components/editor/editor-group/mapping-editor/MappingTestableEditor.tsx +159 -366
  92. package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx +187 -61
  93. package/src/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.tsx +26 -18
  94. package/src/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.tsx +85 -83
  95. package/src/components/editor/editor-group/testable/TestableSharedComponents.tsx +2 -2
  96. package/src/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.ts +75 -4
  97. package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +157 -69
  98. package/src/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.ts +45 -10
  99. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +37 -15
  100. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.ts +15 -8
  101. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.ts +57 -6
  102. package/src/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.ts +10 -6
  103. package/src/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.ts +92 -3
  104. package/src/stores/editor/utils/MockDataUtils.ts +109 -1
  105. package/src/stores/editor/utils/TestableUtils.ts +4 -19
  106. package/src/stores/graph-modifier/DSL_Data_GraphModifierHelper.ts +45 -6
  107. package/src/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.ts +1 -1
  108. package/src/stores/graph-modifier/STO_Relational_GraphModifierHelper.ts +6 -0
@@ -18,7 +18,6 @@ import { observer } from 'mobx-react-lite';
18
18
  import {
19
19
  type Class,
20
20
  type MappingTestSuite,
21
- type StoreTestData,
22
21
  type Store,
23
22
  type DataElement,
24
23
  ModelStore,
@@ -62,9 +61,7 @@ import {
62
61
  TimesCircleIcon,
63
62
  PanelLoadingIndicator,
64
63
  ContextMenu,
65
- PURE_ModelStoreIcon,
66
- PURE_UnknownElementTypeIcon,
67
- PURE_DatabaseIcon,
64
+ ModalHeader,
68
65
  } from '@finos/legend-art';
69
66
  import {
70
67
  assertErrorThrown,
@@ -120,9 +117,15 @@ import { EmbeddedDataType } from '../../../../stores/editor/editor-state/Externa
120
117
  import type { EmbeddedDataTypeOption } from '../../../../stores/editor/editor-state/element-editor-state/data/DataEditorState.js';
121
118
  import {
122
119
  buildElementOption,
120
+ getPackageableElementOptionFormatter,
123
121
  type PackageableElementOption,
124
122
  } from '@finos/legend-lego/graph-editor';
125
123
 
124
+ const SOURCE_CLASS_FORM_TITLE = 'Source Class To Add Data';
125
+ const SOURCE_CLASS_FORM_PROMPT = 'Source class to provide test data for';
126
+ const TARGET_CLASS_FORM_TITLE = 'Target Class To Test';
127
+ const TARGET_CLASS_FORM_PROMPT =
128
+ 'Mapped class for which you would like to build test query';
126
129
  interface ClassSelectOption {
127
130
  label: string;
128
131
  value: Class;
@@ -153,21 +156,14 @@ const CreateTestSuiteModal = observer(
153
156
  }
154
157
  return MAPPING_TEST_SUITE_TYPE.QUERY;
155
158
  };
156
- const getDefaultSuiteNamePrefix = (
157
- type: MAPPING_TEST_SUITE_TYPE,
158
- _class: Class | undefined,
159
- ): string => {
160
- if (type === MAPPING_TEST_SUITE_TYPE.QUERY && _class) {
161
- return `${_class.name}_suite`;
162
- }
163
- return 'suite';
164
- };
165
159
  // Class mapping selector
166
160
  const compatibleClasses = getMappingCompatibleClasses(
167
161
  mapping,
168
162
  editorStore.graphManagerState.usableClasses,
169
163
  );
170
- const mappedClassSelectorRef = useRef<SelectComponent>(null);
164
+ const inputRef = useRef<HTMLInputElement>(null);
165
+
166
+ const handleEnter = (): void => inputRef.current?.focus();
171
167
  const mappedClassOptions = uniq(compatibleClasses)
172
168
  .map((e) => ({
173
169
  label: e.name,
@@ -185,26 +181,14 @@ const CreateTestSuiteModal = observer(
185
181
  : null;
186
182
  // init states
187
183
  const [suiteType, setSuiteType] = useState(getDefaultSuite(selectedClass));
188
- const [suiteName, setSuiteName] = useState(
189
- generateEnumerableNameFromToken(
190
- mapping.tests.map((e) => e.id),
191
- getDefaultSuiteNamePrefix(suiteType, selectedClass),
192
- ),
193
- );
194
- const isValid = selectedClass && suiteName;
195
- const handleEnterClassMappingSelectorModal = (): void =>
196
- mappedClassSelectorRef.current?.focus();
184
+ const [suiteName, setSuiteName] = useState<string | undefined>(undefined);
185
+ const [testName, setTestName] = useState<string | undefined>(undefined);
197
186
 
187
+ const isValid = selectedClass && suiteName && testName;
198
188
  const changeClassOption = (val: ClassSelectOption | null): void => {
199
189
  if (val?.value) {
200
190
  setSelectedClass(val.value);
201
191
  setSuiteType(getDefaultSuite(val.value));
202
- setSuiteName(
203
- generateEnumerableNameFromToken(
204
- mapping.tests.map((e) => e.id),
205
- getDefaultSuiteNamePrefix(suiteType, selectedClass),
206
- ),
207
- );
208
192
  } else {
209
193
  setSelectedClass(undefined);
210
194
  setSuiteType(getDefaultSuite(undefined));
@@ -214,12 +198,13 @@ const CreateTestSuiteModal = observer(
214
198
  // model
215
199
  const close = (): void => creatorState.setShowModal(false);
216
200
  const create = (): void => {
217
- if (selectedClass && suiteName) {
201
+ if (selectedClass && suiteName && testName) {
218
202
  flowResult(
219
203
  creatorState.createAndAddTestSuite(
220
204
  selectedClass,
221
205
  suiteType,
222
206
  suiteName,
207
+ testName,
223
208
  ),
224
209
  ).catch(editorStore.applicationStore.alertUnhandledError);
225
210
  }
@@ -229,44 +214,67 @@ const CreateTestSuiteModal = observer(
229
214
  open={creatorState.showModal}
230
215
  onClose={close}
231
216
  TransitionProps={{
232
- onEnter: handleEnterClassMappingSelectorModal,
217
+ onEnter: handleEnter,
233
218
  }}
234
219
  classes={{ container: 'search-modal__container' }}
235
220
  PaperProps={{ classes: { root: 'search-modal__inner-container' } }}
236
221
  >
237
- <Modal darkMode={true} className="search-modal">
238
- <ModalTitle title="Create Test Suite" />
222
+ <Modal darkMode={true}>
223
+ <ModalHeader>
224
+ <ModalTitle title="Create Mapping Test Suite" />
225
+ </ModalHeader>
239
226
  <ModalBody>
227
+ <PanelLoadingIndicator
228
+ isLoading={creatorState.isCreatingSuiteState.isInProgress}
229
+ />
230
+ {creatorState.isCreatingSuiteState.message && (
231
+ <div className="service-registration-editor__progress-msg">
232
+ {`${creatorState.isCreatingSuiteState.message}...`}
233
+ </div>
234
+ )}
235
+ <PanelFormTextField
236
+ ref={inputRef}
237
+ name="Test Suite Name"
238
+ prompt="Unique Identifier for Test suite i.e Person_suite"
239
+ value={suiteName}
240
+ update={(value: string | undefined): void =>
241
+ setSuiteName(value ?? '')
242
+ }
243
+ errorMessage={validateTestableId(suiteName, undefined)}
244
+ />
245
+ <PanelFormTextField
246
+ name="Test Name"
247
+ prompt="Unique Identifier for first test in suite"
248
+ value={testName}
249
+ update={(value: string | undefined): void =>
250
+ setTestName(value ?? '')
251
+ }
252
+ errorMessage={validateTestableId(testName, undefined)}
253
+ />
240
254
  <div className="panel__content__form__section">
241
255
  <div className="panel__content__form__section__header__label">
242
- Target Class To Test
256
+ Class Mapping
243
257
  </div>
244
258
  <div className="panel__content__form__section__header__prompt">
245
- Mapped class for which you would like to build test suite for
259
+ Mapped Class for which you would like to build test suite for
246
260
  </div>
247
261
  <CustomSelectorInput
248
- ref={mappedClassSelectorRef}
249
262
  options={mappedClassOptions}
250
263
  onChange={changeClassOption}
251
264
  value={selectedClassOption}
265
+ formatOptionLabel={getPackageableElementOptionFormatter({})}
252
266
  darkMode={true}
253
267
  placeholder="Choose a class..."
254
268
  isClearable={true}
255
269
  />
256
270
  </div>
257
- <PanelFormTextField
258
- name="Test Suite Name"
259
- prompt=""
260
- value={suiteName}
261
- update={(value: string | undefined): void =>
262
- setSuiteName(value ?? '')
263
- }
264
- errorMessage={validateTestableId(suiteName, undefined)}
265
- />
266
271
  </ModalBody>
267
272
  <ModalFooter>
268
273
  <ModalFooterButton
269
- disabled={!isValid}
274
+ disabled={
275
+ !isValid || creatorState.isCreatingSuiteState.isInProgress
276
+ }
277
+ title={'Create Test'}
270
278
  onClick={create}
271
279
  text="Create"
272
280
  />
@@ -301,7 +309,7 @@ const CreateTestModal = observer(
301
309
  };
302
310
  // class
303
311
  const [selectedClass, setSelectedClass] = useState<Class | undefined>(
304
- compatibleClasses[0],
312
+ mappingSuiteState.getDefaultClass(),
305
313
  );
306
314
  const selectedClassOption = selectedClass
307
315
  ? {
@@ -350,6 +358,15 @@ const CreateTestModal = observer(
350
358
  mappingSuiteState.addNewTest(id, selectedClass);
351
359
  close();
352
360
  };
361
+
362
+ const modalTitle =
363
+ mappingSuiteState instanceof MappingDataTestSuiteState
364
+ ? TARGET_CLASS_FORM_TITLE
365
+ : SOURCE_CLASS_FORM_TITLE;
366
+ const modalPrompt =
367
+ mappingSuiteState instanceof MappingDataTestSuiteState
368
+ ? TARGET_CLASS_FORM_PROMPT
369
+ : SOURCE_CLASS_FORM_PROMPT;
353
370
  return (
354
371
  <Dialog
355
372
  open={mappingSuiteState.showCreateModal}
@@ -373,25 +390,23 @@ const CreateTestModal = observer(
373
390
  : undefined
374
391
  }
375
392
  />
376
- {mappingSuiteState instanceof MappingDataTestSuiteState && (
377
- <div className="panel__content__form__section">
378
- <div className="panel__content__form__section__header__label">
379
- Target Class To Test
380
- </div>
381
- <div className="panel__content__form__section__header__prompt">
382
- Mapped class for which you would like to build test suite for
383
- </div>
384
- <CustomSelectorInput
385
- ref={mappedClassSelectorRef}
386
- options={mappedClassOptions}
387
- onChange={changeClassOption}
388
- value={selectedClassOption}
389
- darkMode={true}
390
- placeholder="Choose a class..."
391
- isClearable={true}
392
- />
393
+ <div className="panel__content__form__section">
394
+ <div className="panel__content__form__section__header__label">
395
+ {modalTitle}
393
396
  </div>
394
- )}
397
+ <div className="panel__content__form__section__header__prompt">
398
+ {modalPrompt}
399
+ </div>
400
+ <CustomSelectorInput
401
+ ref={mappedClassSelectorRef}
402
+ options={mappedClassOptions}
403
+ onChange={changeClassOption}
404
+ value={selectedClassOption}
405
+ darkMode={true}
406
+ placeholder="Choose a class..."
407
+ isClearable={true}
408
+ />
409
+ </div>
395
410
  </ModalBody>
396
411
  <ModalFooter>
397
412
  <ModalFooterButton
@@ -870,93 +885,6 @@ const MappingTestAssertionsEditor = observer(
870
885
  },
871
886
  );
872
887
 
873
- const StoreTestDataContextMenu = observer(
874
- forwardRef<
875
- HTMLDivElement,
876
- {
877
- storeTestData: StoreTestData;
878
- deleteStoreData: () => void;
879
- }
880
- >(function TestContainerContextMenu(props, ref) {
881
- const { deleteStoreData } = props;
882
- const remove = (): void => deleteStoreData();
883
-
884
- return (
885
- <MenuContent ref={ref}>
886
- <MenuContentItem onClick={remove}>Delete</MenuContentItem>
887
- </MenuContent>
888
- );
889
- }),
890
- );
891
-
892
- const StoreTestDataItem = observer(
893
- (props: {
894
- mappingTestableDataState: MappingTestableDataState;
895
- storeTestData: StoreTestData;
896
- }) => {
897
- const { storeTestData, mappingTestableDataState } = props;
898
- const [isSelectedFromContextMenu, setIsSelectedFromContextMenu] =
899
- useState(false);
900
- const store = storeTestData.store.value;
901
- const isReadOnly =
902
- mappingTestableDataState.mappingTestableState.mappingEditorState
903
- .isReadOnly;
904
- const openConnectionTestData = (): void =>
905
- mappingTestableDataState.openStoreTestData(storeTestData);
906
- const isActive =
907
- mappingTestableDataState.selectedDataState?.storeTestData ===
908
- storeTestData;
909
- const deleteStoreTestData = (): void =>
910
- mappingTestableDataState.deleteStoreTestData(storeTestData);
911
- const onContextMenuOpen = (): void => setIsSelectedFromContextMenu(true);
912
- const onContextMenuClose = (): void => setIsSelectedFromContextMenu(false);
913
- const icon =
914
- store instanceof ModelStore ? (
915
- <PURE_ModelStoreIcon />
916
- ) : store instanceof Database ? (
917
- <PURE_DatabaseIcon />
918
- ) : (
919
- <PURE_UnknownElementTypeIcon />
920
- );
921
-
922
- return (
923
- <ContextMenu
924
- className={clsx(
925
- 'testable-test-assertion-explorer__item',
926
- {
927
- 'testable-test-assertion-explorer__item--selected-from-context-menu':
928
- !isActive && isSelectedFromContextMenu,
929
- },
930
- { 'testable-test-assertion-explorer__item--active': isActive },
931
- )}
932
- disabled={isReadOnly}
933
- content={
934
- <StoreTestDataContextMenu
935
- storeTestData={storeTestData}
936
- deleteStoreData={deleteStoreTestData}
937
- />
938
- }
939
- menuProps={{ elevation: 7 }}
940
- onOpen={onContextMenuOpen}
941
- onClose={onContextMenuClose}
942
- >
943
- <button
944
- className={clsx('testable-test-assertion-explorer__item__label')}
945
- onClick={openConnectionTestData}
946
- tabIndex={-1}
947
- >
948
- <div className="testable-test-assertion-explorer__item__label__icon testable-test-assertion-explorer__test-result-indicator__container">
949
- {icon}
950
- </div>
951
- <div className="testable-test-assertion-explorer__item__label__text">
952
- {store.name}
953
- </div>
954
- </button>
955
- </ContextMenu>
956
- );
957
- },
958
- );
959
-
960
888
  const StoreTestDataEditor = observer(
961
889
  (props: {
962
890
  mappingTestableDataState: MappingTestableDataState;
@@ -971,16 +899,9 @@ const StoreTestDataEditor = observer(
971
899
  <div className="service-test-suite-editor__header">
972
900
  <div className="service-test-suite-editor__header__title">
973
901
  <div className="service-test-suite-editor__header__title__label">
974
- data
902
+ test data input
975
903
  </div>
976
904
  </div>
977
- <div className="panel__header__actions">
978
- <div
979
- className={clsx('panel__content__form__section__toggler', {
980
- 'panel__content__form__section__toggler--disabled': isReadOnly,
981
- })}
982
- ></div>
983
- </div>
984
905
  </div>
985
906
  <EmbeddedDataEditor
986
907
  isReadOnly={isReadOnly}
@@ -999,188 +920,34 @@ const MappingTestableStoreDataEditor = observer(
999
920
  };
1000
921
  return (
1001
922
  <div className="service-test-data-editor panel">
1002
- <div className="service-test-suite-editor__header">
1003
- <div className="service-test-suite-editor__header__title">
1004
- <div className="service-test-suite-editor__header__title__label service-test-suite-editor__header__title__label--data">
1005
- Data
1006
- </div>
1007
- </div>
1008
- </div>
1009
- <div className="service-test-data-editor__data">
1010
- {mappingTestableDataState.dataHolder.storeTestData.length ? (
1011
- <ResizablePanelGroup orientation="vertical">
1012
- <ResizablePanel minSize={100}>
1013
- <div className="binding-editor__header">
1014
- <div className="binding-editor__header__title">
1015
- <div className="binding-editor__header__title__label">
1016
- stores
1017
- </div>
1018
- </div>
1019
- <div className="panel__header__actions">
1020
- <button
1021
- className="panel__header__action"
1022
- tabIndex={-1}
1023
- onClick={addStoreTestData}
1024
- title="Add Store Test Data"
1025
- >
1026
- <PlusIcon />
1027
- </button>
1028
- </div>
1029
- </div>
1030
- <div>
1031
- {mappingTestableDataState.dataHolder.storeTestData.map(
1032
- (storeTestData) => (
1033
- <StoreTestDataItem
1034
- key={storeTestData.store.value.name}
1035
- storeTestData={storeTestData}
1036
- mappingTestableDataState={mappingTestableDataState}
1037
- />
1038
- ),
1039
- )}
1040
- </div>
1041
- </ResizablePanel>
1042
- <ResizablePanelSplitter>
1043
- <ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
1044
- </ResizablePanelSplitter>
1045
- <ResizablePanel minSize={600}>
1046
- <PanelLoadingIndicator
1047
- isLoading={Boolean(
1048
- mappingTestableDataState.selectedDataState
1049
- ?.generatingTestDataSate.isInProgress,
1050
- )}
1051
- />
1052
- {mappingTestableDataState.selectedDataState && (
1053
- <StoreTestDataEditor
1054
- storeTestDataState={
1055
- mappingTestableDataState.selectedDataState
1056
- }
1057
- mappingTestableDataState={mappingTestableDataState}
1058
- />
1059
- )}
1060
- </ResizablePanel>
1061
- </ResizablePanelGroup>
1062
- ) : (
1063
- <BlankPanelPlaceholder
1064
- text="Add Store Test Data"
1065
- onClick={addStoreTestData}
1066
- clickActionType="add"
1067
- tooltipText="Click to add store test data"
1068
- />
1069
- )}
1070
- {mappingTestableDataState.showNewModal && (
1071
- <CreateStoreTestDataModal
1072
- mappingTestableDataState={mappingTestableDataState}
923
+ {mappingTestableDataState.dataHolder.storeTestData.length ? (
924
+ <>
925
+ <PanelLoadingIndicator
926
+ isLoading={Boolean(
927
+ mappingTestableDataState.selectedDataState
928
+ ?.generatingTestDataSate.isInProgress,
929
+ )}
1073
930
  />
1074
- )}
1075
- </div>
1076
- </div>
1077
- );
1078
- },
1079
- );
1080
-
1081
- const MappingDataTestSetupEditor = observer(
1082
- (props: { mappingDataTestState: MappingDataTestState }) => {
1083
- const { mappingDataTestState } = props;
1084
- const test = mappingDataTestState.test;
1085
- return (
1086
- <div className="panel service-test-editor">
1087
- <div className="panel__header">
1088
- <div className="service-test-suite-editor__header__title">
1089
- <div className="service-test-suite-editor__header__title__label">
1090
- setup
1091
- </div>
1092
- </div>
1093
- </div>
1094
- <div className="service-test-editor__content">
1095
- <ResizablePanelGroup orientation="horizontal">
1096
- <ResizablePanel size={150} minSize={28}>
1097
- <div className="service-test-data-editor panel">
1098
- <div className="service-test-suite-editor__header">
1099
- <div className="service-test-suite-editor__header__title">
1100
- <div className="service-test-suite-editor__header__title__label">
1101
- configuration
1102
- </div>
1103
- </div>
1104
- </div>
1105
- <div className="service-test-editor__setup__configuration">
1106
- <PanelFormTextField
1107
- name="Documentation"
1108
- prompt="Test Documentation"
1109
- value={test.doc}
1110
- update={(value: string | undefined): void =>
1111
- atomicTest_setDoc(test, value ?? undefined)
1112
- }
1113
- />
1114
- </div>
1115
- </div>
1116
- </ResizablePanel>
1117
- <ResizablePanelSplitter>
1118
- <ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
1119
- </ResizablePanelSplitter>
1120
- <ResizablePanel minSize={56}>
1121
- <MappingTestableStoreDataEditor
1122
- mappingTestableDataState={mappingDataTestState.dataState}
1123
- />
1124
- </ResizablePanel>
1125
- </ResizablePanelGroup>
1126
- </div>
1127
- </div>
1128
- );
1129
- },
1130
- );
1131
-
1132
- const MappingQueryTestSetupEditor = observer(
1133
- (props: { mappingQueryTestState: MappingQueryTestState }) => {
1134
- const { mappingQueryTestState } = props;
1135
- const test = mappingQueryTestState.test;
1136
- const mappingTestableState = mappingQueryTestState.mappingTestableState;
1137
- const queryState = mappingQueryTestState.queryState;
1138
- const isReadOnly =
1139
- mappingQueryTestState.mappingTestableState.mappingEditorState.isReadOnly;
1140
- return (
1141
- <div className="panel service-test-editor">
1142
- <div className="panel__header">
1143
- <div className="service-test-suite-editor__header__title">
1144
- <div className="service-test-suite-editor__header__title__label">
1145
- setup
1146
- </div>
1147
- </div>
1148
- </div>
1149
- <div className="service-test-editor__content">
1150
- <ResizablePanelGroup orientation="horizontal">
1151
- <ResizablePanel size={150} minSize={28}>
1152
- <div className="service-test-data-editor panel">
1153
- <div className="service-test-suite-editor__header">
1154
- <div className="service-test-suite-editor__header__title">
1155
- <div className="service-test-suite-editor__header__title__label">
1156
- configuration
1157
- </div>
1158
- </div>
1159
- </div>
1160
- <div className="service-test-editor__setup__configuration">
1161
- <PanelFormTextField
1162
- name="Documentation"
1163
- prompt="Test Documentation"
1164
- value={test.doc}
1165
- update={(value: string | undefined): void =>
1166
- atomicTest_setDoc(test, value)
1167
- }
1168
- />
1169
- </div>
1170
- </div>
1171
- </ResizablePanel>
1172
- <ResizablePanelSplitter>
1173
- <ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
1174
- </ResizablePanelSplitter>
1175
- <ResizablePanel minSize={56}>
1176
- <MappingTestableQueryEditor
1177
- testableQueryState={queryState}
1178
- mappingTestableState={mappingTestableState}
1179
- isReadOnly={isReadOnly}
931
+ {mappingTestableDataState.selectedDataState && (
932
+ <StoreTestDataEditor
933
+ storeTestDataState={mappingTestableDataState.selectedDataState}
934
+ mappingTestableDataState={mappingTestableDataState}
1180
935
  />
1181
- </ResizablePanel>
1182
- </ResizablePanelGroup>
1183
- </div>
936
+ )}
937
+ </>
938
+ ) : (
939
+ <BlankPanelPlaceholder
940
+ text="Add Store Test Data"
941
+ onClick={addStoreTestData}
942
+ clickActionType="add"
943
+ tooltipText="Click to add store test data"
944
+ />
945
+ )}
946
+ {mappingTestableDataState.showNewModal && (
947
+ <CreateStoreTestDataModal
948
+ mappingTestableDataState={mappingTestableDataState}
949
+ />
950
+ )}
1184
951
  </div>
1185
952
  );
1186
953
  },
@@ -1190,20 +957,48 @@ const MappingTestEditor = observer(
1190
957
  (props: { mappingTestState: MappingTestState }) => {
1191
958
  const { mappingTestState } = props;
1192
959
  const selectedTab = mappingTestState.selectedTab;
1193
-
960
+ const isReadOnly =
961
+ mappingTestState.mappingTestableState.mappingEditorState.isReadOnly;
1194
962
  const renderMappingSetupTestEditor = (): React.ReactNode => {
1195
- if (mappingTestState instanceof MappingDataTestState) {
1196
- return (
1197
- <MappingDataTestSetupEditor mappingDataTestState={mappingTestState} />
1198
- );
1199
- } else if (mappingTestState instanceof MappingQueryTestState) {
1200
- return (
1201
- <MappingQueryTestSetupEditor
1202
- mappingQueryTestState={mappingTestState}
1203
- />
1204
- );
1205
- }
1206
- return null;
963
+ const test = mappingTestState.test;
964
+ return (
965
+ <div className="panel mapping-testable-editorr">
966
+ <div className="mapping-testable-editor__content">
967
+ <ResizablePanelGroup orientation="horizontal">
968
+ <ResizablePanel size={150}>
969
+ <div className="service-test-data-editor panel">
970
+ <div className="service-test-editor__setup__configuration">
971
+ <PanelFormTextField
972
+ name="Test Documentation"
973
+ value={test.doc}
974
+ update={(value: string | undefined): void =>
975
+ atomicTest_setDoc(test, value)
976
+ }
977
+ />
978
+ </div>
979
+ </div>
980
+ </ResizablePanel>
981
+ <ResizablePanelSplitter>
982
+ <ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
983
+ </ResizablePanelSplitter>
984
+ <ResizablePanel>
985
+ {mappingTestState instanceof MappingQueryTestState && (
986
+ <MappingTestableQueryEditor
987
+ testableQueryState={mappingTestState.queryState}
988
+ mappingTestableState={mappingTestState.mappingTestableState}
989
+ isReadOnly={isReadOnly}
990
+ />
991
+ )}
992
+ {mappingTestState instanceof MappingDataTestState && (
993
+ <MappingTestableStoreDataEditor
994
+ mappingTestableDataState={mappingTestState.dataState}
995
+ />
996
+ )}
997
+ </ResizablePanel>
998
+ </ResizablePanelGroup>
999
+ </div>
1000
+ </div>
1001
+ );
1207
1002
  };
1208
1003
  return (
1209
1004
  <div className="service-test-editor panel">
@@ -1229,7 +1024,7 @@ const MappingTestEditor = observer(
1229
1024
  {selectedTab === TESTABLE_TEST_TAB.SETUP &&
1230
1025
  renderMappingSetupTestEditor()}
1231
1026
 
1232
- {selectedTab === TESTABLE_TEST_TAB.ASSERTIONS && (
1027
+ {selectedTab === TESTABLE_TEST_TAB.ASSERTION && (
1233
1028
  <MappingTestAssertionsEditor
1234
1029
  mappingDataTestState={mappingTestState}
1235
1030
  />
@@ -1348,15 +1143,20 @@ const MappingTestItem = observer(
1348
1143
  const MappingTestSuiteEditor = observer(
1349
1144
  (props: { mappingTestSuiteState: MappingTestSuiteState }) => {
1350
1145
  const { mappingTestSuiteState } = props;
1146
+ const editorStore = mappingTestSuiteState.editorStore;
1351
1147
  const selectedTestState = mappingTestSuiteState.selectTestState;
1352
1148
  const isReadOnly =
1353
1149
  mappingTestSuiteState.mappingTestableState.mappingEditorState.isReadOnly;
1354
1150
  const addTest = (): void => mappingTestSuiteState.setShowModal(true);
1355
1151
  const runTests = (): void => {
1356
- mappingTestSuiteState.runTests();
1152
+ flowResult(mappingTestSuiteState.runSuite()).catch(
1153
+ editorStore.applicationStore.alertUnhandledError,
1154
+ );
1357
1155
  };
1358
1156
  const runFailingTests = (): void => {
1359
- mappingTestSuiteState.runFailingTests();
1157
+ flowResult(mappingTestSuiteState.runFailingTests()).catch(
1158
+ editorStore.applicationStore.alertUnhandledError,
1159
+ );
1360
1160
  };
1361
1161
  const renderMappingTestSuiteDriver = (): React.ReactNode => {
1362
1162
  if (mappingTestSuiteState instanceof MappingDataTestSuiteState) {
@@ -1435,7 +1235,7 @@ const MappingTestSuiteEditor = observer(
1435
1235
  </div>
1436
1236
  </div>
1437
1237
  <PanelContent>
1438
- {mappingTestSuiteState.testsStates.map((test) => (
1238
+ {mappingTestSuiteState.testStates.map((test) => (
1439
1239
  <MappingTestItem
1440
1240
  key={test.uuid}
1441
1241
  mappingTestState={test}
@@ -1636,15 +1436,8 @@ export const MappingTestableEditor = observer(
1636
1436
  <ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
1637
1437
  </ResizablePanelSplitter>
1638
1438
  <ResizablePanel minSize={56}>
1639
- <div className="panel service-test-editor">
1640
- <div className="service-test-suite-editor__header">
1641
- <div className="service-test-suite-editor__header__title">
1642
- <div className="service-test-suite-editor__header__title__label service-test-suite-editor__header__title__label--tests-suites">
1643
- suite
1644
- </div>
1645
- </div>
1646
- </div>
1647
- <div className="service-test-editor__content">
1439
+ <div className="panel mapping-testable-editorr">
1440
+ <div className="mapping-testable-editor__content">
1648
1441
  {renderSuiteState()}
1649
1442
  </div>
1650
1443
  </div>