提交 c636abee 编写于 作者: 辛宝Otto's avatar 辛宝Otto 🥊

fix: watchEffect 在 iOS 表现行为和 web 对齐,抹平差异

上级 740a387d
......@@ -6,7 +6,6 @@ describe('watchEffect', () => {
const isAndroid = platformInfo.startsWith('android')
const isIos = platformInfo.startsWith('ios')
const isWeb = platformInfo.startsWith('web')
beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor('view')
......@@ -22,10 +21,7 @@ describe('watchEffect', () => {
// track
const watchCountTrackNum = await page.$('#watch-count-track-num')
if (isAndroid) {
expect(await watchCountTrackNum.text()).toBe('3')
} else if (isIos) {
// TODO: 确认 IOS 的差异是否正常
expect(await watchCountTrackNum.text()).toBe('11')
expect(await watchCountTrackNum.text()).toBe('3')
} else {
expect(await watchCountTrackNum.text()).toBe('6')
}
......@@ -46,8 +42,6 @@ describe('watchEffect', () => {
if (isAndroid) {
expect(await watchCountTrackNum.text()).toBe('3')
} else if (isIos) {
expect(await watchCountTrackNum.text()).toBe('19')
} else {
expect(await watchCountTrackNum.text()).toBe('9')
}
......@@ -64,9 +58,7 @@ describe('watchEffect', () => {
if (isAndroid) {
expect(await watchCountTrackNum.text()).toBe('3')
} else if (isIos) {
expect(await watchCountTrackNum.text()).toBe('27')
} else {
} else {
expect(await watchCountTrackNum.text()).toBe('12')
}
expect(await watchCountCleanupRes.text()).toBe('watch count cleanup: 2')
......@@ -85,9 +77,7 @@ describe('watchEffect', () => {
if (isAndroid) {
expect(await watchCountTrackNum.text()).toBe('3')
} else if (isIos) {
expect(await watchCountTrackNum.text()).toBe('27')
} else {
} else {
expect(await watchCountTrackNum.text()).toBe('12')
}
expect(await watchCountCleanupRes.text()).toBe('watch count cleanup: 2')
......@@ -157,4 +147,4 @@ describe('watchEffect', () => {
const watchCountAndObjNumRes = await page.$('#watch-count-obj-num-res')
expect(await watchCountAndObjNumRes.text()).toBe('count: 3, obj.num: 1')
})
})
\ No newline at end of file
})
......@@ -24,9 +24,6 @@ describe('watchPostEffect', () => {
const watchCountTrackNum = await page.$('#watch-count-track-num')
if (isAndroid) {
expect(await watchCountTrackNum.text()).toBe('3')
} else if (isIos) {
// TODO: 确认 IOS 的差异是否正常
expect(await watchCountTrackNum.text()).toBe('8')
} else {
expect(await watchCountTrackNum.text()).toBe('3')
}
......@@ -52,8 +49,6 @@ describe('watchPostEffect', () => {
if (isAndroid) {
expect(await watchCountTrackNum.text()).toBe('3')
} else if (isIos) {
expect(await watchCountTrackNum.text()).toBe('16')
} else {
expect(await watchCountTrackNum.text()).toBe('6')
}
......@@ -70,8 +65,6 @@ describe('watchPostEffect', () => {
if (isAndroid) {
expect(await watchCountTrackNum.text()).toBe('3')
} else if (isIos) {
expect(await watchCountTrackNum.text()).toBe('24')
} else {
expect(await watchCountTrackNum.text()).toBe('9')
}
......@@ -92,8 +85,6 @@ describe('watchPostEffect', () => {
if (isAndroid) {
expect(await watchCountTrackNum.text()).toBe('3')
} else if (isIos) {
expect(await watchCountTrackNum.text()).toBe('24')
} else {
expect(await watchCountTrackNum.text()).toBe('9')
}
......@@ -146,4 +137,4 @@ describe('watchPostEffect', () => {
const watchCountAndObjNumRes = await page.$('#watch-count-obj-num-res')
expect(await watchCountAndObjNumRes.text()).toBe('count: 3, obj.num: 1')
})
})
\ No newline at end of file
})
......@@ -24,9 +24,6 @@ describe('watchSyncEffect', () => {
const watchCountTrackNum = await page.$('#watch-count-track-num')
if (isAndroid) {
expect(await watchCountTrackNum.text()).toBe('3')
} else if (isIos) {
// TODO: 确认 IOS 的差异是否正常
expect(await watchCountTrackNum.text()).toBe('11')
} else {
expect(await watchCountTrackNum.text()).toBe('6')
}
......@@ -47,9 +44,6 @@ describe('watchSyncEffect', () => {
if (isAndroid) {
expect(await watchCountTrackNum.text()).toBe('3')
} else if (isIos) {
// TODO: 确认 IOS 的差异是否正常
expect(await watchCountTrackNum.text()).toBe('19')
} else {
expect(await watchCountTrackNum.text()).toBe('9')
}
......@@ -66,9 +60,6 @@ describe('watchSyncEffect', () => {
if (isAndroid) {
expect(await watchCountTrackNum.text()).toBe('3')
} else if (isIos) {
// TODO: 确认 IOS 的差异是否正常
expect(await watchCountTrackNum.text()).toBe('27')
} else {
expect(await watchCountTrackNum.text()).toBe('12')
}
......@@ -89,9 +80,6 @@ describe('watchSyncEffect', () => {
if (isAndroid) {
expect(await watchCountTrackNum.text()).toBe('3')
} else if (isIos) {
// TODO: 确认 IOS 的差异是否正常
expect(await watchCountTrackNum.text()).toBe('27')
} else {
expect(await watchCountTrackNum.text()).toBe('12')
}
......@@ -144,4 +132,4 @@ describe('watchSyncEffect', () => {
const watchCountAndObjNumRes = await page.$('#watch-count-obj-num-res')
expect(await watchCountAndObjNumRes.text()).toBe('count: 3, obj.num: 1')
})
})
\ No newline at end of file
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册