提交 87913c27 编写于 作者: 雪洛's avatar 雪洛

feat: web端放开defineOptions、defineModel测试例

上级 90d6d773
...@@ -435,7 +435,6 @@ ...@@ -435,7 +435,6 @@
"navigationBarTitleText": "defineExpose" "navigationBarTitleText": "defineExpose"
} }
}, },
// #ifdef APP
{ {
"path": "pages/composition-api/basic/define-model/define-model", "path": "pages/composition-api/basic/define-model/define-model",
"style": { "style": {
...@@ -448,7 +447,6 @@ ...@@ -448,7 +447,6 @@
"navigationBarTitleText": "defineOptions" "navigationBarTitleText": "defineOptions"
} }
}, },
// #endif
{ {
"path": "pages/composition-api/basic/define-slots/define-slots", "path": "pages/composition-api/basic/define-slots/define-slots",
"style": { "style": {
......
const PAGE_PATH = '/pages/composition-api/basic/define-model/define-model' const PAGE_PATH = '/pages/composition-api/basic/define-model/define-model'
describe('defineModel', () => { describe('defineModel', () => {
if (process.env.uniTestPlatformInfo.startsWith('web')) {
// TODO: web 端暂不支持
it('web', async () => {
expect(1).toBe(1)
})
return
}
let page = null let page = null
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
...@@ -18,7 +11,7 @@ describe('defineModel', () => { ...@@ -18,7 +11,7 @@ describe('defineModel', () => {
expect(await modelValueText.text()).toBe('modelValue in Foo: str') expect(await modelValueText.text()).toBe('modelValue in Foo: str')
const modelValueInput = await page.$('#model-value-input') const modelValueInput = await page.$('#model-value-input')
expect(await modelValueInput.property('value')).toBe('str') expect(await modelValueInput.value()).toBe('str')
const msgText = await page.$('#msg-text') const msgText = await page.$('#msg-text')
expect(await msgText.text()).toBe('msg in Foo: msg') expect(await msgText.text()).toBe('msg in Foo: msg')
...@@ -27,15 +20,15 @@ describe('defineModel', () => { ...@@ -27,15 +20,15 @@ describe('defineModel', () => {
expect(await defaultNumText.text()).toBe('num: 10') expect(await defaultNumText.text()).toBe('num: 10')
const msgInput = await page.$('#msg-input') const msgInput = await page.$('#msg-input')
expect(await msgInput.property('value')).toBe('msg') expect(await msgInput.value()).toBe('msg')
const updateValueBtn = await page.$('#update-value-btn') const updateValueBtn = await page.$('#update-value-btn')
await updateValueBtn.tap() await updateValueBtn.tap()
expect(await modelValueText.text()).toBe('modelValue in Foo: str1') expect(await modelValueText.text()).toBe('modelValue in Foo: str1')
expect(await modelValueInput.property('value')).toBe('str1') expect(await modelValueInput.value()).toBe('str1')
expect(await msgText.text()).toBe('msg in Foo: msg2') expect(await msgText.text()).toBe('msg in Foo: msg2')
expect(await msgInput.property('value')).toBe('msg2') expect(await msgInput.value()).toBe('msg2')
}) })
}) })
\ No newline at end of file
const PAGE_PATH = '/pages/composition-api/basic/define-options/define-options' const PAGE_PATH = '/pages/composition-api/basic/define-options/define-options'
describe('defineOptions', () => { describe('defineOptions', () => {
if (process.env.uniTestPlatformInfo.startsWith('web')) {
// TODO: web 端暂不支持
it('web', async () => {
expect(1).toBe(1)
})
return
}
let page = null let page = null
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
......
...@@ -59,13 +59,8 @@ ...@@ -59,13 +59,8 @@
}, },
{ {
name: 'defineOptions', name: 'defineOptions',
url: 'define-options', url: 'define-options',
// #ifdef APP
enable: true, enable: true,
// #endif
// #ifdef WEB
enable: false,
// #endif
}, },
{ {
name: 'defineSlots', name: 'defineSlots',
...@@ -74,13 +69,8 @@ ...@@ -74,13 +69,8 @@
}, },
{ {
name: 'defineModel', name: 'defineModel',
url: 'define-model', url: 'define-model',
// #ifdef APP
enable: true, enable: true,
// #endif
// #ifdef WEB
enable: false,
// #endif
}, },
{ {
name: 'useSlots', name: 'useSlots',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册