(t *testing.T)
| 73 | } |
| 74 | |
| 75 | func TestInput(t *testing.T) { |
| 76 | g := setup(t) |
| 77 | |
| 78 | text := "雲の上は\nいつも晴れ" |
| 79 | |
| 80 | p := g.page.MustNavigate(g.srcFile("fixtures/input.html")) |
| 81 | |
| 82 | { |
| 83 | el := p.MustElement("[contenteditable=true]").MustInput(text) |
| 84 | g.Eq(text, el.MustText()) |
| 85 | } |
| 86 | |
| 87 | el := p.MustElement("textarea") |
| 88 | el.MustInput(text) |
| 89 | |
| 90 | g.Eq(text, el.MustText()) |
| 91 | g.True(p.MustHas("[event=textarea-change]")) |
| 92 | |
| 93 | g.Panic(func() { |
| 94 | g.mc.stubErr(1, proto.RuntimeCallFunctionOn{}) |
| 95 | el.MustText() |
| 96 | }) |
| 97 | g.Panic(func() { |
| 98 | g.mc.stubErr(4, proto.RuntimeCallFunctionOn{}) |
| 99 | el.MustInput("") |
| 100 | }) |
| 101 | g.Panic(func() { |
| 102 | g.mc.stubErr(5, proto.RuntimeCallFunctionOn{}) |
| 103 | el.MustInput("") |
| 104 | }) |
| 105 | g.Panic(func() { |
| 106 | g.mc.stubErr(6, proto.RuntimeCallFunctionOn{}) |
| 107 | el.MustInput("") |
| 108 | }) |
| 109 | g.Panic(func() { |
| 110 | g.mc.stubErr(1, proto.InputInsertText{}) |
| 111 | el.MustInput("") |
| 112 | }) |
| 113 | } |
| 114 | |
| 115 | func TestMouse(t *testing.T) { |
| 116 | g := setup(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…