fix(ncform): fixed crach when only number items in array

fix #150
This commit is contained in:
daniel.xiao
2020-08-12 20:43:26 +08:00
committed by Dmitry Nagibin
parent df1cd23f15
commit e5a5e597c6
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -523,7 +523,7 @@ const ncformUtils = {
break;
case "number":
case "integer":
defVal = undefined; // 数字默认值不好给,所以这里给undefined
defVal = ""; // 数字默认值不好给,所以这里给undefined
break;
case "boolean":
defVal = false;
@@ -140,4 +140,12 @@ context('Layout widgets', () => {
})
})
it('array: with number items', () => {
let id = md5('array: with number items');
cy.get(`[data-cy=${id}]`).within(() => {
cy.get('legend').contains('user').as('userLegend');
cy.get('@userLegend').parent().find('button').contains('Add').click();
})
})
})