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

test: textarea 增加auto-height测试例

上级 595fb2e7
...@@ -19,48 +19,28 @@ describe('component-native-textarea', () => { ...@@ -19,48 +19,28 @@ describe('component-native-textarea', () => {
await page.waitFor(500) await page.waitFor(500)
expect(await textarea.attribute("focus")).toBe("false") expect(await textarea.attribute("focus")).toBe("false")
}); });
/* it("auto-height", async () => { it("auto-height", async () => {
await page.setData({ await page.setData({
default_value: "",
auto_height_boolean: true auto_height_boolean: true
}) })
await page.waitFor(500) await page.waitFor(500)
// 原始高度
var { var {
width, width,
height height
} = await textarea.size() } = await textarea.size()
expect(height).toBeGreaterThanOrEqual(150) expect(height).toBeLessThanOrEqual(150)
await page.waitFor(500)
// 只有一行的高度
await page.setData({
maxlength: 3,
})
await page.waitFor(500)
await page.setData({ await page.setData({
default_value: "第一行\n第二行\n第三行", default_value: "1\n2\n3\n4\n5\n6",
auto_height_boolean: false
}) })
await page.waitFor(500) await page.waitFor(500)
var { var {
width, width,
height height
} = await textarea.size() } = await textarea.size()
expect(height).toBeLessThanOrEqual(50) expect(height).toEqual(150)
// 四行的高度
await page.setData({
maxlength: -1,
})
await page.waitFor(500)
await page.setData({
default_value: "第一行\n第二行\n第三行\n第四行",
}) })
await page.waitFor(500)
var {
width,
height
} = await textarea.size()
expect(height).toBeLessThanOrEqual(150)
}) */
it("cursor-color", async () => { it("cursor-color", async () => {
await page.setData({ await page.setData({
cursor_color: "transparent", cursor_color: "transparent",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册