Test RoomInfoByNID

This commit is contained in:
Till Faelligen 2023-02-28 14:15:06 +01:00
parent 9a27511b24
commit 20c3471a2b
No known key found for this signature in database
GPG key ID: ACCDC9606D472758

View file

@ -278,6 +278,16 @@ func TestPurgeRoom(t *testing.T) {
if roomInfo == nil { if roomInfo == nil {
t.Fatalf("room does not exist") t.Fatalf("room does not exist")
} }
//
roomInfo2, err := db.RoomInfoByNID(ctx, roomInfo.RoomNID)
if err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(roomInfo, roomInfo2) {
t.Fatalf("expected roomInfos to be the same, but they aren't")
}
// remember the roomInfo before purging // remember the roomInfo before purging
existingRoomInfo := roomInfo existingRoomInfo := roomInfo
@ -333,6 +343,10 @@ func TestPurgeRoom(t *testing.T) {
if roomInfo != nil { if roomInfo != nil {
t.Fatalf("room should not exist after purging: %+v", roomInfo) t.Fatalf("room should not exist after purging: %+v", roomInfo)
} }
roomInfo2, err = db.RoomInfoByNID(ctx, existingRoomInfo.RoomNID)
if err == nil {
t.Fatalf("expected room to not exist, but it does: %#v", roomInfo2)
}
// validation below // validation below