Skip to content

Commit 57dfa13

Browse files
committed
fix dop cp ut
1 parent 3b347eb commit 57dfa13

File tree

2 files changed

+4
-1
lines changed
  • modules/dop/component-protocol/components/auto-test-scenes/rightPage/fileDetail/fileConfig/scenesConfig/stagesOperations/apiEditorDrawer/apiEditorContainer/apiEditor

2 files changed

+4
-1
lines changed

modules/dop/component-protocol/components/auto-test-scenes/rightPage/fileDetail/fileConfig/scenesConfig/stagesOperations/apiEditorDrawer/apiEditorContainer/apiEditor/helper.go

+1
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ func genProps(input, execute string, replaceOpts ...replaceOption) cptype.Compon
373373
var propsI cptype.ComponentProps
374374
if err := json.Unmarshal([]byte(propsJson), &propsI); err != nil {
375375
logrus.Errorf("init props name=testplan component=formModal propsType=CreateTestPlan err: errMsg: %v", err)
376+
return cptype.ComponentProps{}
376377
}
377378

378379
return propsI

modules/dop/component-protocol/components/auto-test-scenes/rightPage/fileDetail/fileConfig/scenesConfig/stagesOperations/apiEditorDrawer/apiEditorContainer/apiEditor/helper_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import (
1919
"testing"
2020

2121
"github.com/stretchr/testify/assert"
22+
23+
"github.com/erda-project/erda-infra/providers/component-protocol/cptype"
2224
)
2325

2426
func TestGenEmptyAPISpecStr(t *testing.T) {
@@ -51,7 +53,7 @@ func Test_genProps(t *testing.T) {
5153
},
5254
},
5355
},
54-
want: nil,
56+
want: cptype.ComponentProps{},
5557
},
5658
}
5759
for _, tt := range tests {

0 commit comments

Comments
 (0)