提交 eaaf45c2 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

update: pages/component/textarea/textarea.uvue

上级 54153d79
...@@ -11,6 +11,25 @@ describe('component-native-textarea', () => { ...@@ -11,6 +11,25 @@ describe('component-native-textarea', () => {
await page.waitFor(1000); await page.waitFor(1000);
}); });
beforeEach(async () => {
await page.setData({
jest_result: false,
})
});
if(process.env.uniTestPlatformInfo.startsWith('android')){
it("input event triggered when the default value is", async () => {
await program.adbCommand("input text 1")
await page.waitFor(2000)
let res = await page.data('jest_result');
expect(res).toBe(true)
})
it("reset status", async () => {
await program.adbCommand("input keyevent KEYCODE_DEL")
await page.waitFor(2000)
})
}
it('focus', async () => { it('focus', async () => {
expect(await textarea.attribute("focus")).toBe("true") expect(await textarea.attribute("focus")).toBe("true")
await page.setData({ await page.setData({
......
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
selectionStart: -1, selectionStart: -1,
selectionEnd: -1, selectionEnd: -1,
hold_keyboard: false, hold_keyboard: false,
adjust_position: false adjust_position: false,
jest_result: false
} }
}, },
...@@ -36,7 +37,10 @@ ...@@ -36,7 +37,10 @@
textarea_tap() { console.log("手指触摸后马上离开") }, textarea_tap() { console.log("手指触摸后马上离开") },
textarea_longpress() { console.log("如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。") }, textarea_longpress() { console.log("如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。") },
textarea_confirm() { console.log("点击完成时, 触发 confirm 事件,event.detail = {value: value}") }, textarea_confirm() { console.log("点击完成时, 触发 confirm 事件,event.detail = {value: value}") },
textarea_input() { console.log("当键盘输入时,触发 input 事件,event.detail = {value, cursor}, @input 处理函数的返回值并不会反映到 textarea 上") }, textarea_input() {
console.log("当键盘输入时,触发 input 事件,event.detail = {value, cursor}, @input 处理函数的返回值并不会反映到 textarea 上")
this.jest_result = true
},
textarea_linechange() { console.log("输入框行数变化时调用,event.detail = {height: 0, height: 0, lineCount: 0}") }, textarea_linechange() { console.log("输入框行数变化时调用,event.detail = {height: 0, height: 0, lineCount: 0}") },
textarea_blur() { console.log("输入框失去焦点时触发,event.detail = {value, cursor}") }, textarea_blur() { console.log("输入框失去焦点时触发,event.detail = {value, cursor}") },
textarea_keyboardheightchange() { console.log("键盘高度发生变化的时候触发此事件,event.detail = {height: height, duration: duration}") }, textarea_keyboardheightchange() { console.log("键盘高度发生变化的时候触发此事件,event.detail = {height: height, duration: duration}") },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册