提交 367bafe8 编写于 作者: 雪洛's avatar 雪洛

test: $getPageStyle应返回UTSJSONObject

上级 9fbe4769
......@@ -38,8 +38,11 @@ describe('getCurrentPages', () => {
await page.callMethod('getPageStyle')
await page.waitFor(200)
const isEnablePullDownRefresh2 = (await page.data()).currentPageStyle.enablePullDownRefresh
const data2 = await page.data()
const isEnablePullDownRefresh2 = data2.currentPageStyle.enablePullDownRefresh
const currentPageStyleIsUTSJSONObject2 = data2.currentPageStyleIsUTSJSONObject
expect(isEnablePullDownRefresh2).toBe(false)
expect(currentPageStyleIsUTSJSONObject2).toBe(true)
await page.callMethod('startPullDownRefresh')
await page.waitFor(500)
......
......@@ -33,6 +33,7 @@
checked: false,
pages: [] as Page[],
currentPageStyle: {} as UTSJSONObject,
currentPageStyleIsUTSJSONObject: true,
// TODO
enablePullDownRefreshStatus: true
}
......@@ -65,7 +66,8 @@
getPageStyle() {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
this.currentPageStyle = currentPage.$getPageStyle();
this.currentPageStyle = currentPage.$getPageStyle();
this.currentPageStyleIsUTSJSONObject = this.currentPageStyle instanceof UTSJSONObject
},
setPageStyle(enable : boolean) {
// 目前仅支持 enablePullDownRefresh
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册