From 4de54bf72812f91bfbcc4d4d044c717e32f0a17a Mon Sep 17 00:00:00 2001 From: yyc-git <395976266@qq.com> Date: Sun, 17 Dec 2023 17:43:46 +0800 Subject: [PATCH] test(platform): pass bdd test note: because increase antd version before, so antd->Select now error when render:Unable to find node on an unmounted component. so handle it. --- doc/1.0.0-beta1_3.org | 12 +- .../lib/bs/.compiler.log | 4 +- .../lib/bs/.ninja_log | 14 +- .../ServiceType-Meta3dEditorWholeProtocol.cmt | Bin 6090 -> 6090 bytes .../ui_controls/components/UIControls.res | 2 +- .../ui/app/utils/utils/SelectUtils.res | 73 +- .../apInspector.steps.bs.js.snap | 1281 ++++++++ .../contributeInspector.steps.bs.js.snap | 3 + .../contributes.steps.bs.js.snap | 67 + .../elementVisual.steps.bs.js.snap | 18 + .../extensionInspector.steps.bs.js.snap | 3 + .../__snapshots__/extensions.steps.bs.js.snap | 67 + .../fix_assembleSpace_bug.steps.bs.js.snap | 67 + .../__snapshots__/publish.steps.bs.js.snap | 16 + .../runElementVisual.steps.bs.js.snap | 15 + ...unElementVisualController.steps.bs.js.snap | 31 + .../selectedContributes.steps.bs.js.snap | 204 ++ .../selectedExtensions.steps.bs.js.snap | 204 ++ .../uiControlInspector.steps.bs.js.snap | 2826 +++++++++++++++++ .../step-definitions/apInspector.steps.res | 2 + ...ckage_contributeInspector.steps.bs.js.snap | 3 + .../package_contributes.steps.bs.js.snap | 67 + ...ackage_extensionInspector.steps.bs.js.snap | 51 + .../package_extensions.steps.bs.js.snap | 67 + .../package_packages.steps.bs.js.snap | 116 + ...ckage_selectedContributes.steps.bs.js.snap | 204 ++ ...ackage_selectedExtensions.steps.bs.js.snap | 204 ++ .../package_selectedPackages.steps.bs.js.snap | 204 ++ .../publish_package.steps.bs.js.snap | 16 + .../store/elementAssembleStore.steps.res | 170 +- .../uiControlInspector.steps.res | 1 + .../step-definitions/uiControls.steps.res | 6 +- .../test/tool/CanvasControllerTool.res | 4 +- platform/frontend/test/tool/PublishTool.res | 4 +- .../tool/RunElementVisualControllerTool.res | 2 +- platform/frontend/test/tool/SelectTool.res | 5 + .../test/tool/SelectedUIControlsTool.res | 9 +- .../test/tool/UIControlInspectorTool.res | 6 +- .../frontend/test/tool/UIControlsTool.res | 4 +- 39 files changed, 5931 insertions(+), 121 deletions(-) create mode 100644 platform/frontend/test/step-definitions/__snapshots__/apInspector.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/__snapshots__/contributeInspector.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/__snapshots__/contributes.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/__snapshots__/elementVisual.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/__snapshots__/extensionInspector.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/__snapshots__/extensions.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/__snapshots__/fix_assembleSpace_bug.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/__snapshots__/publish.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/__snapshots__/runElementVisual.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/__snapshots__/runElementVisualController.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/__snapshots__/selectedContributes.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/__snapshots__/selectedExtensions.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/__snapshots__/uiControlInspector.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/package/__snapshots__/package_contributeInspector.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/package/__snapshots__/package_contributes.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/package/__snapshots__/package_extensionInspector.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/package/__snapshots__/package_extensions.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/package/__snapshots__/package_packages.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/package/__snapshots__/package_selectedContributes.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/package/__snapshots__/package_selectedExtensions.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/package/__snapshots__/package_selectedPackages.steps.bs.js.snap create mode 100644 platform/frontend/test/step-definitions/package/__snapshots__/publish_package.steps.bs.js.snap create mode 100644 platform/frontend/test/tool/SelectTool.res diff --git a/doc/1.0.0-beta1_3.org b/doc/1.0.0-beta1_3.org index e3f879b97..eaff23461 100755 --- a/doc/1.0.0-beta1_3.org +++ b/doc/1.0.0-beta1_3.org @@ -128,7 +128,7 @@ TODO save status ** TODO Assemble Space -*** TODO create from scratch add guide +*** DONE create from scratch add guide use https://ant.design/components/steps use https://ant.design/components/tour @@ -177,17 +177,17 @@ TODO add End Tutorial button commit -TODO first jump to Tour component -# show preview -show run button +# TODO first jump to Tour component +# # show preview +# show run button TODO pass bdd test -*** TODO create with template add guide +# *** TODO create with template add guide -only use https://ant.design/components/tour +# only use https://ant.design/components/tour diff --git a/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.compiler.log b/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.compiler.log index 0b1ba6e01..8ede2df5c 100644 --- a/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.compiler.log +++ b/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.compiler.log @@ -1,2 +1,2 @@ -#Start(1702717379676) -#Done(1702717379738) +#Start(1702805232011) +#Done(1702805232065) diff --git a/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.ninja_log b/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.ninja_log index da17ec72c..1ff613703 100644 --- a/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.ninja_log +++ b/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.ninja_log @@ -1,8 +1,8 @@ # ninja log v6 -0 27 1702717379700894470 src/service/ServiceType.ast 785165cefc5839bb -1 28 1702717379700791515 Meta3dEditorWholeProtocol.cmi 27dde7c45547adb8 -27 37 1702717379712743877 src/service/ServiceType.d 702d225c4edca7ca -37 62 1702717379736453793 src/service/ServiceType-Meta3dEditorWholeProtocol.cmj 7bc3463955dc59bf -37 62 1702717379736453793 src/service/ServiceType-Meta3dEditorWholeProtocol.cmi 7bc3463955dc59bf -37 62 1702717379736453793 ../es6_global/src/service/ServiceType.bs.js 7bc3463955dc59bf -37 62 1702717379736453793 ../js/src/service/ServiceType.bs.js 7bc3463955dc59bf +0 17 1702805232027531928 src/service/ServiceType.ast 785165cefc5839bb +1 18 1702805232027754434 Meta3dEditorWholeProtocol.cmi 27dde7c45547adb8 +17 25 1702805232036441071 src/service/ServiceType.d 702d225c4edca7ca +25 54 1702805232063124022 src/service/ServiceType-Meta3dEditorWholeProtocol.cmj 3cdbb78846c97d5f +25 54 1702805232063124022 src/service/ServiceType-Meta3dEditorWholeProtocol.cmi 3cdbb78846c97d5f +25 54 1702805232063124022 ../es6_global/src/service/ServiceType.bs.js 3cdbb78846c97d5f +25 54 1702805232063124022 ../js/src/service/ServiceType.bs.js 3cdbb78846c97d5f diff --git a/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/src/service/ServiceType-Meta3dEditorWholeProtocol.cmt b/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/src/service/ServiceType-Meta3dEditorWholeProtocol.cmt index 09e606daf870cb3041c86a5ce7f57c793d9c4ba1..410444a1fff29873afa4669acc2097e0e06309be 100644 GIT binary patch delta 59 zcmX@5e@cJDEdf1C6I0XF6f+Zx)MPVVL-RyKkbq^9sj+E_Nis~p%qY#&z&OPubu)+H GAvORZBM|HW delta 59 zcmX@5e@cJDEdf0f6SFj service.console.error(. errorMessage, None) | None => - let id = IdUtils.generateId(Js.Math.random) + let id = IdUtils.generateId(service.other.random) dispatch( ElementAssembleStoreType.SelectUIControl( diff --git a/platform/frontend/src/external_layer/ui/app/utils/utils/SelectUtils.res b/platform/frontend/src/external_layer/ui/app/utils/utils/SelectUtils.res index 52d94ffd6..bcc0b4491 100755 --- a/platform/frontend/src/external_layer/ui/app/utils/utils/SelectUtils.res +++ b/platform/frontend/src/external_layer/ui/app/utils/utils/SelectUtils.res @@ -1,3 +1,9 @@ +let _isNotShowSelectForTest = %raw(` +function (){ +return globalThis.isNotShowSelectForTest +} +`) + let buildEmptySelectOptionValue = () => "empty" let isEmptySelectOptionValue = value => @@ -6,42 +12,57 @@ let isEmptySelectOptionValue = value => let buildSelect = (onChange, defaultValue, values) => { open Antd - + { + _isNotShowSelectForTest() + ? React.null + : + } } let buildSelectWithoutEmpty = (onChange, defaultValue, values) => { open Antd - + { + _isNotShowSelectForTest() + ? React.null + : + } } let buildSelectWithKeysAndWithoutEmpty = (onChange, defaultValue, keys, values) => { open Antd - + { + _isNotShowSelectForTest() + ? React.null + : + } } let buildSelect2 = () => React.null diff --git a/platform/frontend/test/step-definitions/__snapshots__/apInspector.steps.bs.js.snap b/platform/frontend/test/step-definitions/__snapshots__/apInspector.steps.bs.js.snap new file mode 100644 index 000000000..3f98fe86e --- /dev/null +++ b/platform/frontend/test/step-definitions/__snapshots__/apInspector.steps.bs.js.snap @@ -0,0 +1,1281 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ApInsepctor show clearColor r input 1`] = ` +
+
+

+ 2 +

+
+
+

+ 2 +

+
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+

+ 2 +

+
+
+`; + +exports[`ApInsepctor show isDebug select 1`] = ` +
+
+

+ 2 +

+
+
+

+ 2 +

+
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+

+ 2 +

+
+
+`; + +exports[`ApInsepctor show nothing 1`] = `null`; + +exports[`ApInsepctor show skin name select 1`] = ` +
+
+

+ 2 +

+
+
+

+ 2 +

+
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+

+ 2 +

+
+
+`; diff --git a/platform/frontend/test/step-definitions/__snapshots__/contributeInspector.steps.bs.js.snap b/platform/frontend/test/step-definitions/__snapshots__/contributeInspector.steps.bs.js.snap new file mode 100644 index 000000000..ab8f30354 --- /dev/null +++ b/platform/frontend/test/step-definitions/__snapshots__/contributeInspector.steps.bs.js.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ContributeInspector show nothing 1`] = `null`; diff --git a/platform/frontend/test/step-definitions/__snapshots__/contributes.steps.bs.js.snap b/platform/frontend/test/step-definitions/__snapshots__/contributes.steps.bs.js.snap new file mode 100644 index 000000000..d464cf18e --- /dev/null +++ b/platform/frontend/test/step-definitions/__snapshots__/contributes.steps.bs.js.snap @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Contributes show contributes list 1`] = ` +
+
+
+
+
+
+ + + + + + + + + +
+
+ No data +
+
+
+
+
+
+`; diff --git a/platform/frontend/test/step-definitions/__snapshots__/elementVisual.steps.bs.js.snap b/platform/frontend/test/step-definitions/__snapshots__/elementVisual.steps.bs.js.snap new file mode 100644 index 000000000..31e2bf9a3 --- /dev/null +++ b/platform/frontend/test/step-definitions/__snapshots__/elementVisual.steps.bs.js.snap @@ -0,0 +1,18 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ElementVisual show canvas 1`] = ` + +`; diff --git a/platform/frontend/test/step-definitions/__snapshots__/extensionInspector.steps.bs.js.snap b/platform/frontend/test/step-definitions/__snapshots__/extensionInspector.steps.bs.js.snap new file mode 100644 index 000000000..c2e8cfed6 --- /dev/null +++ b/platform/frontend/test/step-definitions/__snapshots__/extensionInspector.steps.bs.js.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ExtensionInspector show nothing 1`] = `null`; diff --git a/platform/frontend/test/step-definitions/__snapshots__/extensions.steps.bs.js.snap b/platform/frontend/test/step-definitions/__snapshots__/extensions.steps.bs.js.snap new file mode 100644 index 000000000..4cc872e5a --- /dev/null +++ b/platform/frontend/test/step-definitions/__snapshots__/extensions.steps.bs.js.snap @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Extensions show extensions list exclude selected extensions 1`] = ` +
+
+
+
+
+
+ + + + + + + + + +
+
+ No data +
+
+
+
+
+
+`; diff --git a/platform/frontend/test/step-definitions/__snapshots__/fix_assembleSpace_bug.steps.bs.js.snap b/platform/frontend/test/step-definitions/__snapshots__/fix_assembleSpace_bug.steps.bs.js.snap new file mode 100644 index 000000000..2af0327ec --- /dev/null +++ b/platform/frontend/test/step-definitions/__snapshots__/fix_assembleSpace_bug.steps.bs.js.snap @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Fix AssembleSpace Bug fix "enter AssembleSpace should reset" bug 1`] = ` +
+
+
+
+
+
+ + + + + + + + + +
+
+ No data +
+
+
+
+
+
+`; diff --git a/platform/frontend/test/step-definitions/__snapshots__/publish.steps.bs.js.snap b/platform/frontend/test/step-definitions/__snapshots__/publish.steps.bs.js.snap new file mode 100644 index 000000000..6d6e6b77b --- /dev/null +++ b/platform/frontend/test/step-definitions/__snapshots__/publish.steps.bs.js.snap @@ -0,0 +1,16 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Publish show publish button 1`] = ` + +`; diff --git a/platform/frontend/test/step-definitions/__snapshots__/runElementVisual.steps.bs.js.snap b/platform/frontend/test/step-definitions/__snapshots__/runElementVisual.steps.bs.js.snap new file mode 100644 index 000000000..e907a1c5e --- /dev/null +++ b/platform/frontend/test/step-definitions/__snapshots__/runElementVisual.steps.bs.js.snap @@ -0,0 +1,15 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`RunElementVisual show the canvas 1`] = ` + +`; diff --git a/platform/frontend/test/step-definitions/__snapshots__/runElementVisualController.steps.bs.js.snap b/platform/frontend/test/step-definitions/__snapshots__/runElementVisualController.steps.bs.js.snap new file mode 100644 index 000000000..c2eb42206 --- /dev/null +++ b/platform/frontend/test/step-definitions/__snapshots__/runElementVisualController.steps.bs.js.snap @@ -0,0 +1,31 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`RunElementVisualController if data not ready, show waiting 1`] = ` + +`; + +exports[`RunElementVisualController if data ready, show run button 1`] = ` + +`; diff --git a/platform/frontend/test/step-definitions/__snapshots__/selectedContributes.steps.bs.js.snap b/platform/frontend/test/step-definitions/__snapshots__/selectedContributes.steps.bs.js.snap new file mode 100644 index 000000000..4feed75c2 --- /dev/null +++ b/platform/frontend/test/step-definitions/__snapshots__/selectedContributes.steps.bs.js.snap @@ -0,0 +1,204 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Selected Contributes show selected contributes 1`] = ` +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + d1 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + d1 + +
+
+
+
+
+
+
+
+
+
+
+
+`; diff --git a/platform/frontend/test/step-definitions/__snapshots__/selectedExtensions.steps.bs.js.snap b/platform/frontend/test/step-definitions/__snapshots__/selectedExtensions.steps.bs.js.snap new file mode 100644 index 000000000..4955e1160 --- /dev/null +++ b/platform/frontend/test/step-definitions/__snapshots__/selectedExtensions.steps.bs.js.snap @@ -0,0 +1,204 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Selected Extensions show selected extensions 1`] = ` +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+`; diff --git a/platform/frontend/test/step-definitions/__snapshots__/uiControlInspector.steps.bs.js.snap b/platform/frontend/test/step-definitions/__snapshots__/uiControlInspector.steps.bs.js.snap new file mode 100644 index 000000000..997bae211 --- /dev/null +++ b/platform/frontend/test/step-definitions/__snapshots__/uiControlInspector.steps.bs.js.snap @@ -0,0 +1,2826 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`UIControlInsepctor show default action and action select 1`] = ` +
+
+

+ 2 +

+
+
+
+
+
+
+ + X: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+ + Y: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+ + 宽: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+ + 高: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+
+
+

+ 2 +

+
+
+

+ 2 +

+
+
+

+ 2 +

+
+
+
+
+
+
    +
  • +
    +
    +
    +
    + + button_click: + +
    +
    +
    +
    +
  • +
+
+
+
+
+
+
+
+`; + +exports[`UIControlInsepctor show default data 1`] = ` +
+
+

+ 2 +

+
+
+
+
+
+
+ + X: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+ + Y: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+ + 宽: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+ + 高: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+
+
+

+ 2 +

+
+
+

+ 2 +

+
+
+

+ 2 +

+
+
+
+
+
+
+
+
+ + + + + + + + + +
+
+ No data +
+
+
+
+
+
+
+
+
+
+`; + +exports[`UIControlInsepctor show input 1`] = ` +
+
+

+ 2 +

+
+
+
+
+
+
+ + X: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+ + Y: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+ + 宽: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+ + 高: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+
+
+

+ 2 +

+
+
+

+ 2 +

+
+
+

+ 2 +

+
+
+
+
+
+
+
+
+ + + + + + + + + +
+
+ No data +
+
+
+
+
+
+
+
+
+
+`; + +exports[`UIControlInsepctor show nothing 1`] = ` +
+
+

+ 2 +

+
+
+
+
+
+
+ + X: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+ + Y: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+ + 宽: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+ + 高: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+
+
+

+ 2 +

+
+
+

+ 2 +

+
+
+

+ 2 +

+
+
+
+
+
+
+
+
+ + + + + + + + + +
+
+ No data +
+
+
+
+
+
+
+
+
+
+`; + +exports[`UIControlInsepctor show specific 1`] = ` +
+
+

+ 2 +

+
+
+
+
+
+
+ + X: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+ + Y: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+ + 宽: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+ + 高: + +
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+
+
+

+ 2 +

+
+
+

+ 2 +

+
+
+
+
+
+
+ label +
+
+
+
+ +
+
+
+
+

+ 2 +

+
+
+
+
+
+
+
+
+ + + + + + + + + +
+
+ No data +
+
+
+
+
+
+
+
+
+
+`; diff --git a/platform/frontend/test/step-definitions/apInspector.steps.res b/platform/frontend/test/step-definitions/apInspector.steps.res index 6615c616b..48d32f61f 100755 --- a/platform/frontend/test/step-definitions/apInspector.steps.res +++ b/platform/frontend/test/step-definitions/apInspector.steps.res @@ -17,6 +17,8 @@ defineFeature(feature, test => { given("prepare", () => { sandbox := createSandbox() ReactTestTool.prepare() + + SelectTool.markNotShowSelectForTest() }) } diff --git a/platform/frontend/test/step-definitions/package/__snapshots__/package_contributeInspector.steps.bs.js.snap b/platform/frontend/test/step-definitions/package/__snapshots__/package_contributeInspector.steps.bs.js.snap new file mode 100644 index 000000000..ad0120664 --- /dev/null +++ b/platform/frontend/test/step-definitions/package/__snapshots__/package_contributeInspector.steps.bs.js.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PackageContributeInspector show nothing 1`] = `null`; diff --git a/platform/frontend/test/step-definitions/package/__snapshots__/package_contributes.steps.bs.js.snap b/platform/frontend/test/step-definitions/package/__snapshots__/package_contributes.steps.bs.js.snap new file mode 100644 index 000000000..c7c223a51 --- /dev/null +++ b/platform/frontend/test/step-definitions/package/__snapshots__/package_contributes.steps.bs.js.snap @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PackageContributes show contributes list 1`] = ` +
+
+
+
+
+
+ + + + + + + + + +
+
+ No data +
+
+
+
+
+
+`; diff --git a/platform/frontend/test/step-definitions/package/__snapshots__/package_extensionInspector.steps.bs.js.snap b/platform/frontend/test/step-definitions/package/__snapshots__/package_extensionInspector.steps.bs.js.snap new file mode 100644 index 000000000..65c60e071 --- /dev/null +++ b/platform/frontend/test/step-definitions/package/__snapshots__/package_extensionInspector.steps.bs.js.snap @@ -0,0 +1,51 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PackageExtensionInspector show mark entry button 1`] = ` +
+
+ +
+
+`; + +exports[`PackageExtensionInspector show nothing 1`] = `null`; + +exports[`PackageExtensionInspector show unmark entry button 1`] = ` +
+
+ +
+
+`; diff --git a/platform/frontend/test/step-definitions/package/__snapshots__/package_extensions.steps.bs.js.snap b/platform/frontend/test/step-definitions/package/__snapshots__/package_extensions.steps.bs.js.snap new file mode 100644 index 000000000..6cf1a2cf4 --- /dev/null +++ b/platform/frontend/test/step-definitions/package/__snapshots__/package_extensions.steps.bs.js.snap @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PackageExtensions show extensions list 1`] = ` +
+
+
+
+
+
+ + + + + + + + + +
+
+ No data +
+
+
+
+
+
+`; diff --git a/platform/frontend/test/step-definitions/package/__snapshots__/package_packages.steps.bs.js.snap b/platform/frontend/test/step-definitions/package/__snapshots__/package_packages.steps.bs.js.snap new file mode 100644 index 000000000..dc4d8f2fb --- /dev/null +++ b/platform/frontend/test/step-definitions/package/__snapshots__/package_packages.steps.bs.js.snap @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PackagePackages show packages list exclude selected packages 1`] = ` +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + p2 + +
+
+
+
+
+
+
+
+
+
+
+
+`; diff --git a/platform/frontend/test/step-definitions/package/__snapshots__/package_selectedContributes.steps.bs.js.snap b/platform/frontend/test/step-definitions/package/__snapshots__/package_selectedContributes.steps.bs.js.snap new file mode 100644 index 000000000..0514061a6 --- /dev/null +++ b/platform/frontend/test/step-definitions/package/__snapshots__/package_selectedContributes.steps.bs.js.snap @@ -0,0 +1,204 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Package Selected Contributes show selected contributes 1`] = ` +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + d1 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + d1 + +
+
+
+
+
+
+
+
+
+
+
+
+`; diff --git a/platform/frontend/test/step-definitions/package/__snapshots__/package_selectedExtensions.steps.bs.js.snap b/platform/frontend/test/step-definitions/package/__snapshots__/package_selectedExtensions.steps.bs.js.snap new file mode 100644 index 000000000..afe481546 --- /dev/null +++ b/platform/frontend/test/step-definitions/package/__snapshots__/package_selectedExtensions.steps.bs.js.snap @@ -0,0 +1,204 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Package Selected Extensions show selected extensions 1`] = ` +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+`; diff --git a/platform/frontend/test/step-definitions/package/__snapshots__/package_selectedPackages.steps.bs.js.snap b/platform/frontend/test/step-definitions/package/__snapshots__/package_selectedPackages.steps.bs.js.snap new file mode 100644 index 000000000..41bd2a042 --- /dev/null +++ b/platform/frontend/test/step-definitions/package/__snapshots__/package_selectedPackages.steps.bs.js.snap @@ -0,0 +1,204 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Package Selected Packages show selected packages 1`] = ` +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + p1 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ + p2 + +
+
+
+
+
+
+
+
+
+
+
+
+`; diff --git a/platform/frontend/test/step-definitions/package/__snapshots__/publish_package.steps.bs.js.snap b/platform/frontend/test/step-definitions/package/__snapshots__/publish_package.steps.bs.js.snap new file mode 100644 index 000000000..c13a0f55c --- /dev/null +++ b/platform/frontend/test/step-definitions/package/__snapshots__/publish_package.steps.bs.js.snap @@ -0,0 +1,16 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Publish Package show publish button 1`] = ` + +`; diff --git a/platform/frontend/test/step-definitions/store/elementAssembleStore.steps.res b/platform/frontend/test/step-definitions/store/elementAssembleStore.steps.res index c3c281243..64581c796 100755 --- a/platform/frontend/test/step-definitions/store/elementAssembleStore.steps.res +++ b/platform/frontend/test/step-definitions/store/elementAssembleStore.steps.res @@ -35,24 +35,36 @@ defineFeature(feature, test => { \"and"( "select ui control u2 whose parent is u1 with id2", () => { + id1 := "id1" + store := ElementAssembleStore.reducer( store.contents, - ElementAssembleStoreType.SelectUIControl("", "", "", "", Obj.magic(1), None, []), + ElementAssembleStoreType.SelectUIControl( + id1.contents, + "", + "", + "", + Obj.magic(1), + None, + [], + ), ) - id1 := - ( - store.contents.selectedUIControls - ->Meta3dCommonlib.ListSt.head - ->Meta3dCommonlib.OptionSt.getExn - ).id + // id1 := + // ( + // store.contents.selectedUIControls + // ->Meta3dCommonlib.ListSt.head + // ->Meta3dCommonlib.OptionSt.getExn + // ).id + + id2 := "id2" store := ElementAssembleStore.reducer( store.contents, ElementAssembleStoreType.SelectUIControl( - "", + id2.contents, "", "", "", @@ -62,16 +74,16 @@ defineFeature(feature, test => { ), ) - id2 := - ( - ( - store.contents.selectedUIControls - ->Meta3dCommonlib.ListSt.head - ->Meta3dCommonlib.OptionSt.getExn - ).children - ->Meta3dCommonlib.ListSt.head - ->Meta3dCommonlib.OptionSt.getExn - ).id + // id2 := + // ( + // ( + // store.contents.selectedUIControls + // ->Meta3dCommonlib.ListSt.head + // ->Meta3dCommonlib.OptionSt.getExn + // ).children + // ->Meta3dCommonlib.ListSt.head + // ->Meta3dCommonlib.OptionSt.getExn + // ).id }, ) @@ -296,29 +308,41 @@ defineFeature(feature, test => { given( "select ui control u1", () => { + id1 := "id1" + store := ElementAssembleStore.reducer( store.contents, - ElementAssembleStoreType.SelectUIControl("", "", "", "", Obj.magic(1), None, []), + ElementAssembleStoreType.SelectUIControl( + id1.contents, + "", + "", + "", + Obj.magic(1), + None, + [], + ), ) - id1 := - ( - store.contents.selectedUIControls - ->Meta3dCommonlib.ListSt.head - ->Meta3dCommonlib.OptionSt.getExn - ).id + // id1 := + // ( + // store.contents.selectedUIControls + // ->Meta3dCommonlib.ListSt.head + // ->Meta3dCommonlib.OptionSt.getExn + // ).id }, ) \"and"( "select ui control u2 whose parent is u1", () => { + id2 := "id2" + store := ElementAssembleStore.reducer( store.contents, ElementAssembleStoreType.SelectUIControl( - "", + id2.contents, "", "", "", @@ -328,16 +352,16 @@ defineFeature(feature, test => { ), ) - id2 := - ( - ( - store.contents.selectedUIControls - ->Meta3dCommonlib.ListSt.head - ->Meta3dCommonlib.OptionSt.getExn - ).children - ->Meta3dCommonlib.ListSt.head - ->Meta3dCommonlib.OptionSt.getExn - ).id + // id2 := + // ( + // ( + // store.contents.selectedUIControls + // ->Meta3dCommonlib.ListSt.head + // ->Meta3dCommonlib.OptionSt.getExn + // ).children + // ->Meta3dCommonlib.ListSt.head + // ->Meta3dCommonlib.OptionSt.getExn + // ).id }, ) @@ -348,7 +372,7 @@ defineFeature(feature, test => { ElementAssembleStore.reducer( store.contents, ElementAssembleStoreType.SelectUIControl( - "", + "id3", "", "", "", @@ -384,18 +408,28 @@ defineFeature(feature, test => { }) \"and"("select ui control u1 which has children with id1", () => { + id1 := "id1" + store := ElementAssembleStore.reducer( store.contents, - ElementAssembleStoreType.SelectUIControl("", "", "", "", Obj.magic(1), None, []), + ElementAssembleStoreType.SelectUIControl( + id1.contents, + "", + "", + "", + Obj.magic(1), + None, + [], + ), ) - id1 := - ( - store.contents.selectedUIControls - ->Meta3dCommonlib.ListSt.head - ->Meta3dCommonlib.OptionSt.getExn - ).id + // id1 := + // ( + // store.contents.selectedUIControls + // ->Meta3dCommonlib.ListSt.head + // ->Meta3dCommonlib.OptionSt.getExn + // ).id }) } @@ -439,11 +473,13 @@ defineFeature(feature, test => { given( "select ui control u2 which not has children and its parent is u1 with id2", () => { + id2 := "id2" + store := ElementAssembleStore.reducer( store.contents, ElementAssembleStoreType.SelectUIControl( - "", + id2.contents, "", "", "", @@ -453,16 +489,16 @@ defineFeature(feature, test => { ), ) - id2 := - ( - ( - store.contents.selectedUIControls - ->Meta3dCommonlib.ListSt.head - ->Meta3dCommonlib.OptionSt.getExn - ).children - ->Meta3dCommonlib.ListSt.head - ->Meta3dCommonlib.OptionSt.getExn - ).id + // id2 := + // ( + // ( + // store.contents.selectedUIControls + // ->Meta3dCommonlib.ListSt.head + // ->Meta3dCommonlib.OptionSt.getExn + // ).children + // ->Meta3dCommonlib.ListSt.head + // ->Meta3dCommonlib.OptionSt.getExn + // ).id }, ) @@ -510,18 +546,28 @@ defineFeature(feature, test => { }) \"and"("select ui control u1 with id1", () => { + id1 := "id1" + store := ElementAssembleStore.reducer( store.contents, - ElementAssembleStoreType.SelectUIControl("","", "", "", Obj.magic(1), None, []), + ElementAssembleStoreType.SelectUIControl( + id1.contents, + "", + "", + "", + Obj.magic(1), + None, + [], + ), ) - id1 := - ( - store.contents.selectedUIControls - ->Meta3dCommonlib.ListSt.head - ->Meta3dCommonlib.OptionSt.getExn - ).id + // id1 := + // ( + // store.contents.selectedUIControls + // ->Meta3dCommonlib.ListSt.head + // ->Meta3dCommonlib.OptionSt.getExn + // ).id }) \"and"("set input to input1 with id1", () => { diff --git a/platform/frontend/test/step-definitions/uiControlInspector.steps.res b/platform/frontend/test/step-definitions/uiControlInspector.steps.res index 74ad9e5d6..d665162af 100755 --- a/platform/frontend/test/step-definitions/uiControlInspector.steps.res +++ b/platform/frontend/test/step-definitions/uiControlInspector.steps.res @@ -20,6 +20,7 @@ defineFeature(feature, test => { sandbox := createSandbox() ReactTestTool.prepare() + SelectTool.markNotShowSelectForTest() TextareaTool.markNotShowTextareaForTest() }) } diff --git a/platform/frontend/test/step-definitions/uiControls.steps.res b/platform/frontend/test/step-definitions/uiControls.steps.res index 77bed519e..e2742f19b 100755 --- a/platform/frontend/test/step-definitions/uiControls.steps.res +++ b/platform/frontend/test/step-definitions/uiControls.steps.res @@ -85,7 +85,7 @@ defineFeature(feature, test => { let protocolIconBase64 = ref(Obj.magic(1)) let protocolConfigStr = ref(Obj.magic(1)) let sepcific = ref(Obj.magic(1)) - let id = "i1" + let id = "0" let name = ref(Obj.magic(1)) let data = ref(Obj.magic(1)) let execGetContributeFuncStub = ref(Obj.magic(1)) @@ -98,7 +98,7 @@ defineFeature(feature, test => { given( "select uiControl u1 in ap view", () => { - randomStub := createEmptyStub(refJsObjToSandbox(sandbox.contents))->returns(id, _) + randomStub := createEmptyStub(refJsObjToSandbox(sandbox.contents))->returns(0.0, _) protocolIconBase64 := "1" protocolConfigStr := "c" @@ -151,7 +151,7 @@ defineFeature(feature, test => { ->getCall(0, _) ->SinonTool.calledWith( ElementAssembleStoreType.SelectUIControl( - matchAny, + id, protocolIconBase64.contents, protocolConfigStr.contents, name.contents, diff --git a/platform/frontend/test/tool/CanvasControllerTool.res b/platform/frontend/test/tool/CanvasControllerTool.res index a39402474..090033638 100755 --- a/platform/frontend/test/tool/CanvasControllerTool.res +++ b/platform/frontend/test/tool/CanvasControllerTool.res @@ -1,8 +1,8 @@ let buildUI = ( ~sandbox, ~service=ServiceTool.build(~sandbox, ()), - ~canvasWidthInputTarget=Obj.magic(1), - ~canvasHeightInputTarget=Obj.magic(1), + ~canvasWidthInputTarget=Meta3dCommonlib.NullableSt.getEmpty()->Obj.magic, + ~canvasHeightInputTarget=Meta3dCommonlib.NullableSt.getEmpty()->Obj.magic, (), ) => { diff --git a/platform/frontend/test/tool/PublishTool.res b/platform/frontend/test/tool/PublishTool.res index 333250071..54c1f6182 100755 --- a/platform/frontend/test/tool/PublishTool.res +++ b/platform/frontend/test/tool/PublishTool.res @@ -7,8 +7,8 @@ let buildUI = ( ~service=ServiceTool.build(~sandbox, ()), ~handleWhenShowModalFunc=() => (), ~handleWhenPublishFunc=() => (), - ~publishButtonTarget=Obj.magic(1), - ~publishModalTarget=Obj.magic(1), + ~publishButtonTarget=Meta3dCommonlib.NullableSt.getEmpty()->Obj.magic, + ~publishModalTarget=Meta3dCommonlib.NullableSt.getEmpty()->Obj.magic, (), ) => { (), - ~runButtonTarget=Obj.magic(1), + ~runButtonTarget=Meta3dCommonlib.NullableSt.getEmpty()->Obj.magic, ~account="a1"->Some, ~selectedContributes=list{}, (), diff --git a/platform/frontend/test/tool/SelectTool.res b/platform/frontend/test/tool/SelectTool.res new file mode 100644 index 000000000..0466a74c2 --- /dev/null +++ b/platform/frontend/test/tool/SelectTool.res @@ -0,0 +1,5 @@ +let markNotShowSelectForTest = %raw(` +function (){ +globalThis.isNotShowSelectForTest=true +} +`) diff --git a/platform/frontend/test/tool/SelectedUIControlsTool.res b/platform/frontend/test/tool/SelectedUIControlsTool.res index 04e8550c5..0243b2cc9 100755 --- a/platform/frontend/test/tool/SelectedUIControlsTool.res +++ b/platform/frontend/test/tool/SelectedUIControlsTool.res @@ -5,10 +5,11 @@ let buildUI = ( ~handleWhenSelectUIControlFunc=_ => (), ~handleWhenSelectTreeNodeFunc=_ => (), ~selectedContributes=list{}, - ~addUIControlButtonTarget=Obj.magic(1), - ~selectSceneViewUIControlTarget=Obj.magic(1), - ~rootTarget=Obj.magic(1), - ~selectGameViewUIControlTarget=Obj.magic(1), + ~addUIControlButtonTarget=Meta3dCommonlib.NullableSt.getEmpty()->Obj.magic, + ~selectSceneViewUIControlTarget=Meta3dCommonlib.NullableSt.getEmpty()->Obj.magic, + ~rootTarget=Meta3dCommonlib.NullableSt.getEmpty()->Obj.magic, + + ~selectGameViewUIControlTarget=Meta3dCommonlib.NullableSt.getEmpty()->Obj.magic, (), ) => { Obj.magic, + ~rectWidthInputTarget=Meta3dCommonlib.NullableSt.getEmpty()->Obj.magic, + ~rectHeightInputTarget=Meta3dCommonlib.NullableSt.getEmpty()->Obj.magic, (), ) => { (), ~selectedContributes=list{}, ~setIsShowUIControls=ReactHookTool.buildEmptySetStateFunc(), - ~selectSceneViewUIControlTarget=Obj.magic(1), - ~selectGameViewUIControlTarget=Obj.magic(1), + ~selectSceneViewUIControlTarget=Meta3dCommonlib.NullableSt.getEmpty()->Obj.magic, + ~selectGameViewUIControlTarget=Meta3dCommonlib.NullableSt.getEmpty()->Obj.magic, (), ) => {