Add tests for clients sending m.room.power_levels events#146
Add tests for clients sending m.room.power_levels events#146aaronraimist wants to merge 1 commit into
m.room.power_levels events#146Conversation
Signed-off-by: Aaron Raimist <aaron@raim.ist>
| package b | ||
|
|
||
| // BlueprintAliceAndBob is a two user homeserver | ||
| var BlueprintAliceAndBob = MustValidate(Blueprint{ |
There was a problem hiding this comment.
Use BlueprintOneToOneRoom instead. https://github.com/matrix-org/complement/blob/master/internal/b/one_to_one_room.go#L4
| for _, jm := range m.JSON { | ||
| if err = jm(body); err != nil { | ||
| t.Fatalf("MatchResponse %s - %s", err, contextStr) | ||
| t.Errorf("MatchResponse %s - %s", err, contextStr) |
There was a problem hiding this comment.
Please do not do this. It is intended for test assertions in the must package to fail the test immediately and not to continue executing.
| } | ||
|
|
||
| // SendEventSynced sends `e` into the room. | ||
| func (c *CSAPI) SendEvent(t *testing.T, roomID string, e b.Event) *http.Response { |
There was a problem hiding this comment.
Please move this into a helper function inside tests/client_power_levels_test.go and not inside the Complement CSAPI client struct.
The reason for this is because CSAPI should be reserved for functions which are commonly used across many tests, and this function is primarily only useful to check error conditions when sending events. In addition, by having both forms sit alongside each other in CSAPI, it confuses test authors who may prefer to use this function over SendEventSynced which would end up being disasterous as SendEventSynced is the only form which guards against race conditions when processing new events.
Tests for matrix-org/synapse#10232