Fix the tests.
[ssh-chat] / chat / message / user_test.go
index c823c4e479fb312d0057579787e89b386173d3c1..72909a181d24ff7a1548a6cbf83b3a58e4d9ead6 100644 (file)
@@ -14,6 +14,7 @@ func TestMakeUser(t *testing.T) {
 
        cfg := u.Config()
        cfg.Theme = MonoTheme // Mono
+       cfg.Timeformat = nil
        u.SetConfig(cfg)
 
        m := NewAnnounceMsg("hello")
@@ -43,7 +44,7 @@ func TestRenderTimestamp(t *testing.T) {
        cfg.Timeformat = &timefmt
        u.SetConfig(cfg)
 
-       if got, want := cfg.Theme.Timestamp("foo"), `\e[38;05;245mfoo`+Reset; got != want {
+       if got, want := cfg.Theme.Timestamp("foo"), "foo"; got != want {
                t.Errorf("Wrong timestamp formatting:\n got: %q\nwant: %q", got, want)
        }
 
@@ -54,7 +55,7 @@ func TestRenderTimestamp(t *testing.T) {
        u.HandleMsg(u.ConsumeOne())
 
        s.Read(&actual)
-       expected = []byte(`\e[38;05;245mAA:BB` + Reset + `  [\e[38;05;88mfoo\e[0m] hello` + Newline)
+       expected = []byte(`AA:BB  [foo] hello` + Newline)
        if !reflect.DeepEqual(actual, expected) {
                t.Errorf("Wrong screen output:\n Got: `%q`;\nWant: `%q`", actual, expected)
        }