Skip to content

Commit

Permalink
test(platform): pass bdd test
Browse files Browse the repository at this point in the history
  • Loading branch information
yyc-git committed Dec 28, 2023
1 parent 0d717b5 commit ad0fadb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ defineFeature(feature, test => {
test(."show specific", ({given, \"when", \"and", then}) => {
let id = "d1"
let w1 = ref(Obj.magic(1))
let useStateStub = ref(Obj.magic(1))
let useSelectorStub = ref(Obj.magic(1))

_prepare(given)
Expand Down Expand Up @@ -664,9 +665,21 @@ defineFeature(feature, test => {
then(
"should show dom with defalut value",
() => {
useStateStub := createEmptyStub(refJsObjToSandbox(sandbox.contents))
useStateStub.contents
->returns((Obj.magic(1), Obj.magic(1)), _)
->onCall(2, _)
->returns((Meta3dCommonlib.ImmutableHashMap.createEmpty(), Obj.magic(1)), _)
->ignore

UIControlInspectorTool.buildUI(
~sandbox,
~service=ServiceTool.build(~sandbox, ~useSelector=useSelectorStub.contents, ()),
~service=ServiceTool.build(
~sandbox,
~useState=useStateStub.contents,
~useSelector=useSelectorStub.contents,
(),
),
~currentSelectedUIControl=w1.contents,
~currentSelectedUIControlInspectorData=UIControlInspectorTool.buildUIControlInspectorData(
~id,
Expand Down Expand Up @@ -811,9 +824,7 @@ defineFeature(feature, test => {
specific,
id,
i,
"Window2"
->SpecificUtils.convertStringToValue(type_)
->CommonType.SpecicFieldDataValue,
"Window2"->SpecificUtils.convertStringToValue(type_)->CommonType.SpecicFieldDataValue,
type_,
)
},
Expand Down
2 changes: 1 addition & 1 deletion platform/frontend/test/tool/ImportElementTool.res
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// let buildLoaded = assembleData => ElementVisual.Loaded(assembleData)

let convertInput = input => {
input->Meta3dCommonlib.OptionSt.toNullable
input->Meta3dCommonlib.OptionSt.toStrictNullable
}

let convertEvent = event => {
Expand Down

0 comments on commit ad0fadb

Please sign in to comment.