fix: failing tests after Mark logic

This commit is contained in:
efim 2023-11-25 15:29:50 +00:00
parent 31e3f06f3b
commit 0d4e10be40
2 changed files with 47 additions and 2 deletions

View File

@ -19,6 +19,7 @@ var releaseHandTests = []releaseHandTest{
usingMarkToLoverLevel,
releasingNonSpeakerHand,
releaseToPersonWithHandAndMark,
raisingLevelSetMarksWithoutOverridingExisting,
}
func TestRoomReleaseHand(t *testing.T) {
@ -76,7 +77,8 @@ var singleHandActive releaseHandTest = releaseHandTest{
},
}
// 3 person in room, active does expand, next is probingQ, this sets mark for expand
// 3 person in room, active does expand, next is probingQ,
// this sets mark for all levels from 0 to expand
var raisingLevelFromExpandToClarifyingQ releaseHandTest = releaseHandTest{
testName: "raisingLevelFromExpandToClarifyingQ",
room: Room{
@ -105,6 +107,49 @@ var raisingLevelFromExpandToClarifyingQ releaseHandTest = releaseHandTest{
person3.Id: ClarifyingQ,
},
Marks: map[HandGesture]PersonId{
ChangeTopic: person1.Id,
ProbingQ: person1.Id,
Expand: person1.Id,
},
},
}
// 3 person in room, active does expand, next is probingQ,
// already have Mark for Change Topic (0)
// this sets mark for all levels from 1 to expand
var raisingLevelSetMarksWithoutOverridingExisting releaseHandTest = releaseHandTest{
testName: "raisingLevelSetMarksWithoutOverridingExisting",
room: Room{
Name: "test",
CurrentSpeaker: person1.Id,
Paricipants: []PersonId{
person1.Id,
person2.Id,
person3.Id,
},
ParticipantHands: map[PersonId]HandGesture{
person1.Id: Expand,
person3.Id: ClarifyingQ,
},
Marks: map[HandGesture]PersonId{
ChangeTopic: person2.Id,
},
},
releasingParticipantId: person1.Id,
expected: Room{
Name: "test",
CurrentSpeaker: person3.Id,
Paricipants: []PersonId{
person1.Id,
person2.Id,
person3.Id,
},
ParticipantHands: map[PersonId]HandGesture{
person3.Id: ClarifyingQ,
},
Marks: map[HandGesture]PersonId{
ChangeTopic: person2.Id,
ProbingQ: person1.Id,
Expand: person1.Id,
},
},

View File

@ -99,7 +99,7 @@ func streamingRoomStates(
fmt.Fprint(w, "\n\n")
w.(http.Flusher).Flush()
if session.PersonId == room.CurrentSpeaker {
log.Printf("/rooms/subscribe sending 'become-speaker' to %s", session.PersonId)
log.Printf("/rooms/subscribe sending 'become-speaker' to %d", session.PersonId)
fmt.Fprint(w, "event: become-speaker\ndata:yo\n\n")
w.(http.Flusher).Flush()
}