fix: failing tests after Mark logic
This commit is contained in:
parent
31e3f06f3b
commit
0d4e10be40
|
@ -19,6 +19,7 @@ var releaseHandTests = []releaseHandTest{
|
||||||
usingMarkToLoverLevel,
|
usingMarkToLoverLevel,
|
||||||
releasingNonSpeakerHand,
|
releasingNonSpeakerHand,
|
||||||
releaseToPersonWithHandAndMark,
|
releaseToPersonWithHandAndMark,
|
||||||
|
raisingLevelSetMarksWithoutOverridingExisting,
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRoomReleaseHand(t *testing.T) {
|
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{
|
var raisingLevelFromExpandToClarifyingQ releaseHandTest = releaseHandTest{
|
||||||
testName: "raisingLevelFromExpandToClarifyingQ",
|
testName: "raisingLevelFromExpandToClarifyingQ",
|
||||||
room: Room{
|
room: Room{
|
||||||
|
@ -105,6 +107,49 @@ var raisingLevelFromExpandToClarifyingQ releaseHandTest = releaseHandTest{
|
||||||
person3.Id: ClarifyingQ,
|
person3.Id: ClarifyingQ,
|
||||||
},
|
},
|
||||||
Marks: map[HandGesture]PersonId{
|
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,
|
Expand: person1.Id,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -99,7 +99,7 @@ func streamingRoomStates(
|
||||||
fmt.Fprint(w, "\n\n")
|
fmt.Fprint(w, "\n\n")
|
||||||
w.(http.Flusher).Flush()
|
w.(http.Flusher).Flush()
|
||||||
if session.PersonId == room.CurrentSpeaker {
|
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")
|
fmt.Fprint(w, "event: become-speaker\ndata:yo\n\n")
|
||||||
w.(http.Flusher).Flush()
|
w.(http.Flusher).Flush()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue