Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdata committed Oct 20, 2023
1 parent 4fd18ad commit b883516
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion uihtml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"html/template"
"io"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -53,7 +54,7 @@ func TestUiHtml_JawsEvent(t *testing.T) {
defer close(msgCh)
tje := &testJawsEvent{msgCh: msgCh}

id := rq.Register(tje, "attr1", []string{"attr2"}, template.HTML("attr3"), []template.HTML{"attr4"})
id := rq.Register(Tag("zomg"), tje, "attr1", []string{"attr2"}, template.HTML("attr3"), []template.HTML{"attr4"})

rq.inCh <- wsMsg{Data: "text", Jid: id, What: what.Input}
select {
Expand Down Expand Up @@ -107,5 +108,17 @@ func TestUiHtml_JawsEvent(t *testing.T) {
t.Error(s)
}
}
}

func TestUiHtml_JawsRender_panics(t *testing.T) {
defer func() {
x := recover()
if x == nil {
t.Error("expected panic")
}
if !strings.Contains(x.(string), "called") {
t.Error("wrong panic")
}
}()
(&UiHtml{}).JawsRender(nil, nil, nil)
}

0 comments on commit b883516

Please sign in to comment.