提交 eee22915 编写于 作者: Anne_LXM's avatar Anne_LXM

test(scroll-view): 支持 iOS 端测试

上级 9739c6b3
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
}, },
methods: { methods: {
onRefresherrefresh(e : UniRefresherEvent)) { onRefresherrefresh(e : UniRefresherEvent) {
this.refresherrefresh = true this.refresherrefresh = true
console.log("onRefresherrefresh------下拉刷新触发") console.log("onRefresherrefresh------下拉刷新触发")
this.checkEventTest({ this.checkEventTest({
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
this.refresherTriggered = false this.refresherTriggered = false
}, 1500) }, 1500)
}, },
onRefresherabort(e : UniRefresherEvent)) { onRefresherabort(e : UniRefresherEvent) {
console.log("onRefresherabort------下拉刷新被中止") console.log("onRefresherabort------下拉刷新被中止")
this.checkEventTest({ this.checkEventTest({
type:e.type, type:e.type,
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
dy:e.detail.dy, dy:e.detail.dy,
} as RefresherEventTest,'refresherabort') } as RefresherEventTest,'refresherabort')
}, },
onRefresherrestore(e : UniRefresherEvent)) { onRefresherrestore(e : UniRefresherEvent) {
this.refresherrefresh = false this.refresherrefresh = false
console.log("onRefresherrestore------下拉刷新被复位") console.log("onRefresherrestore------下拉刷新被复位")
this.checkEventTest({ this.checkEventTest({
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
dy:e.detail.dy, dy:e.detail.dy,
} as RefresherEventTest,'refresherrestore') } as RefresherEventTest,'refresherrestore')
}, },
onRefresherpulling(e : UniRefresherEvent)) { onRefresherpulling(e : UniRefresherEvent) {
console.log("onRefresherpulling------拉刷新控件被下拉-dy=" + e.detail.dy) console.log("onRefresherpulling------拉刷新控件被下拉-dy=" + e.detail.dy)
this.checkEventTest({ this.checkEventTest({
type:e.type, type:e.type,
......
jest.setTimeout(30000); jest.setTimeout(30000);
describe('component-native-scroll-view', () => { describe('component-native-scroll-view', () => {
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isIos = platformInfo.startsWith('ios')
if (isIos) {
it('dummyTest', () => {
expect(1).toBe(1)
})
return
}
let page; let page;
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch('/pages/component/scroll-view/scroll-view'); page = await program.reLaunch('/pages/component/scroll-view/scroll-view');
...@@ -40,7 +32,7 @@ describe('component-native-scroll-view', () => { ...@@ -40,7 +32,7 @@ describe('component-native-scroll-view', () => {
expect(topScrollDetail.scrollHeight).toBeGreaterThan(0) expect(topScrollDetail.scrollHeight).toBeGreaterThan(0)
expect(topScrollDetail.scrollWidth).toBeGreaterThan(0) expect(topScrollDetail.scrollWidth).toBeGreaterThan(0)
expect(topScrollDetail.deltaX).toBe(0) expect(topScrollDetail.deltaX).toBe(0)
expect(topScrollDetail.deltaY).toBe(-100) expect(topScrollDetail.deltaY).not.toBe(0)
} }
expect(await page.data('isScrollTest')).toBe('scroll:Success') expect(await page.data('isScrollTest')).toBe('scroll:Success')
}) })
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</view> </view>
<view> <view>
<scroll-view :scroll-top="scrollTop" direction="vertical" class="scroll-Y" scroll-with-animation="true" <scroll-view :scroll-top="scrollTop" direction="vertical" class="scroll-Y" scroll-with-animation="true"
@scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" :show-scrollbar="showScrollbar"> @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" @scrollend="end" :show-scrollbar="showScrollbar">
<view class="scroll-view-item uni-bg-red"><text class="text">A</text></view> <view class="scroll-view-item uni-bg-red"><text class="text">A</text></view>
<view class="scroll-view-item uni-bg-green"><text class="text">B</text></view> <view class="scroll-view-item uni-bg-green"><text class="text">B</text></view>
<view class="scroll-view-item uni-bg-blue"><text class="text">C</text></view> <view class="scroll-view-item uni-bg-blue"><text class="text">C</text></view>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册