mirror of
https://github.com/mattermost/mattermost.git
synced 2026-09-01 15:00:08 +08:00
change t.Fatal to assert.Equal in model/status_test.go (#12680)
This commit is contained in:
committed by
Ali Farooq
parent
9ea4c40bcc
commit
d1e46cd216
+6
-22
@@ -16,22 +16,10 @@ func TestStatus(t *testing.T) {
|
||||
json := status.ToJson()
|
||||
status2 := StatusFromJson(strings.NewReader(json))
|
||||
|
||||
if status.UserId != status2.UserId {
|
||||
t.Fatal("UserId should have matched")
|
||||
}
|
||||
|
||||
if status.Status != status2.Status {
|
||||
t.Fatal("Status should have matched")
|
||||
}
|
||||
|
||||
if status.LastActivityAt != status2.LastActivityAt {
|
||||
t.Fatal("LastActivityAt should have matched")
|
||||
}
|
||||
|
||||
if status.Manual != status2.Manual {
|
||||
t.Fatal("Manual should have matched")
|
||||
}
|
||||
|
||||
assert.Equal(t, status.UserId, status2.UserId, "UserId should have matched")
|
||||
assert.Equal(t, status.Status, status2.Status, "Status should have matched")
|
||||
assert.Equal(t, status.LastActivityAt, status2.LastActivityAt, "LastActivityAt should have matched")
|
||||
assert.Equal(t, status.Manual, status2.Manual, "Manual should have matched")
|
||||
assert.Equal(t, "", status2.ActiveChannel)
|
||||
|
||||
json = status.ToClusterJson()
|
||||
@@ -70,10 +58,6 @@ func TestStatusListFromJson(t *testing.T) {
|
||||
toDec := strings.NewReader(jsonStream)
|
||||
statusesFromJson := StatusListFromJson(toDec)
|
||||
|
||||
if statusesFromJson[0].UserId != dat[0]["user_id"] {
|
||||
t.Fatal("UserId should be equal")
|
||||
}
|
||||
if statusesFromJson[1].UserId != dat[1]["user_id"] {
|
||||
t.Fatal("UserId should be equal")
|
||||
}
|
||||
assert.Equal(t, statusesFromJson[0].UserId, dat[0]["user_id"], "UserId should be equal")
|
||||
assert.Equal(t, statusesFromJson[1].UserId, dat[1]["user_id"], "UserId should be equal")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user