提交 a220bccb 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test(v-bind): 增加 css v-bind rpx测试

上级 be566445
......@@ -54,6 +54,7 @@ type DataInfo = {
border : string
fooProps : FooProps
vBindClassBackgroundColor : string,
vBindClassRpxHeight : string,
}
const dataInfo = reactive({
......@@ -68,6 +69,7 @@ const dataInfo = reactive({
}
},
vBindClassBackgroundColor: 'red',
vBindClassRpxHeight: '300rpx'
} as DataInfo)
defineExpose({
......@@ -79,7 +81,7 @@ defineExpose({
/* #ifdef WEB */
.v-bind-css {
background-color: v-bind(dataInfo.vBindClassBackgroundColor);
height: 20px;
height: v-bind(dataInfo.vBindClassRpxHeight);
}
/* #endif */
</style>
......@@ -44,6 +44,7 @@ type DataInfo = {
border: string
fooProps: FooProps
vBindClassBackgroundColor: string
vBindClassRpxHeight: string
}
export default {
......@@ -61,7 +62,8 @@ export default {
name: 'foo obj name'
}
},
vBindClassBackgroundColor: 'red'
vBindClassBackgroundColor: 'red',
vBindClassRpxHeight: '300rpx'
} as DataInfo
}
}
......@@ -72,7 +74,7 @@ export default {
/* #ifdef WEB */
.v-bind-css {
background-color: v-bind(dataInfo.vBindClassBackgroundColor);
height: 20px;
height: v-bind(dataInfo.vBindClassRpxHeight);
}
/* #endif */
</style>
......@@ -4,7 +4,6 @@ const COMPOSITION_PAGE_PATH = '/pages/directive/v-bind/v-bind-composition'
describe('v-bind', () => {
let page
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isIos = platformInfo.startsWith('ios')
const isWeb = platformInfo.startsWith('web')
const isFirefox = platformInfo.indexOf('firefox') > -1
......@@ -50,6 +49,7 @@ describe('v-bind', () => {
if (isWeb) {
const vBindCss = await page.$('.v-bind-css')
expect(await vBindCss.style('backgroundColor')).toBe('rgb(255, 0, 0)')
expect(await vBindCss.style('height')).toBe('150px')
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册