提交 aad5875e 编写于 作者: H hdx

feat(calendar): 新增自动化测试

上级 75c6a85f
const PAGE_PATH = '/pages/template/calendar/calendar'
describe('calendar', () => {
let page
beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(500)
})
it('width', async () => {
const pageData = await page.data()
expect(pageData.testWidth > 0).toBe(true)
})
})
......@@ -39,7 +39,8 @@ export default {
lunar: '',
disabled: false,
is_today: false
} as DateType
} as DateType,
testWidth: 0
}
},
computed: {
......@@ -65,6 +66,10 @@ export default {
// 绘制日历头部
this.drawHeader()
this.drawWeek(this.weeks, '')
// 仅自动化测试
const header = this.$refs['draw-header'] as UniElement
this.testWidth = header.getBoundingClientRect().width;
},
methods: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册