mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-08 22:53:10 -06:00
Update test to correctly check the expected response
This commit is contained in:
parent
7fffef562f
commit
3be8262374
|
|
@ -207,10 +207,16 @@ func TestUserInteractive_AddCompletedStage(t *testing.T) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
u := setup()
|
u := setup()
|
||||||
|
ctx := context.Background()
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
if len(u.Sessions[tt.sessionID]) > 0 {
|
_, resp := u.Verify(ctx, []byte("{}"), nil)
|
||||||
t.Fatalf("expected 0 completed stages, got %d", len(u.Sessions[tt.sessionID]))
|
challenge, ok := resp.JSON.(Challenge)
|
||||||
|
if !ok {
|
||||||
|
t.Fatalf("expected a Challenge, got %T", resp.JSON)
|
||||||
|
}
|
||||||
|
if len(challenge.Completed) > 0 {
|
||||||
|
t.Fatalf("expected 0 completed stages, got %d", len(challenge.Completed))
|
||||||
}
|
}
|
||||||
u.AddCompletedStage(tt.sessionID, "")
|
u.AddCompletedStage(tt.sessionID, "")
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue