Skip to content
Snippets Groups Projects
Commit bfb3b1d3 authored by Jake Taylor's avatar Jake Taylor
Browse files

enhance delete message test case

parent 1e2118e1
Branches
Tags
2 merge requests!60Revert "Fail a test to be sure it works",!13delete old messages when channel is left
......@@ -229,16 +229,17 @@ func TestWasmModel_deleteMsgByChannel(t *testing.T) {
// Store some test messages
cid := channel.Identity{}
for i := 0; i < expectedMessages; i++ {
for i := 0; i < totalMessages; i++ {
testStr := testString + strconv.Itoa(i)
testMsgId := channel.MakeMessageID([]byte(testStr), &id.ID{1})
eventModel.ReceiveMessage(deleteChannel, testMsgId, testStr,
testStr, cid, time.Now(), time.Second, rounds.Round{ID: id.Round(0)}, 0, channels.Sent)
// Interleave the channel id to ensure cursor is behaving intelligently
thisChannel := deleteChannel
if i%2 == 0 {
thisChannel = keepChannel
}
for i := expectedMessages; i < totalMessages; i++ {
testStr := testString + strconv.Itoa(i)
testMsgId := channel.MakeMessageID([]byte(testStr), &id.ID{1})
eventModel.ReceiveMessage(keepChannel, testMsgId, testStr,
eventModel.ReceiveMessage(thisChannel, testMsgId, testStr,
testStr, cid, time.Now(), time.Second, rounds.Round{ID: id.Round(0)}, 0, channels.Sent)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment