test(ncform): add $ncformGetValue api testcase

This commit is contained in:
daniel.xiao
2020-12-06 14:51:24 +08:00
committed by Dmitry Nagibin
parent 5195b0a756
commit 0842c5c0ca
2 changed files with 15 additions and 4 deletions
@@ -87,4 +87,11 @@ context('Others', () => {
})
})
it('$ncformGetValue api', () => {
cy.window().then(win => {
let formName = 'form_' + md5('$ncformGetValue api');
expect(win.Vue.prototype.$ncformGetValue(formName)).to.deep.equal({"showField":"1","obj":{"show":"1"},"arr":[{"show":"1"}]});
})
})
})
@@ -182,12 +182,13 @@
{
id: md5('$ncformGetValue api'),
title: '$ncformGetValue api',
formName: 'form_' + Math.random(),
formName: 'form_' + md5('$ncformGetValue api'),
formSchema: {
type: 'object',
properties: {
showField: {
type: 'string',
value: '1'
},
hiddenField: {
type: 'string',
@@ -199,7 +200,8 @@
type: 'object',
properties: {
show: {
type: 'string'
type: 'string',
value: '1'
},
hide: {
type: 'string',
@@ -215,7 +217,8 @@
type: 'object',
properties: {
show: {
type: 'string'
type: 'string',
value: '1'
},
hide: {
type: 'string',
@@ -224,7 +227,8 @@
},
}
}
}
},
value: [{show: '1', hidden: ''}]
}
},
globalConfig: {