mirror of
https://github.com/signaller-matrix/signaller.git
synced 2024-11-05 02:01:03 +00:00
Add LogoutAll() test
This commit is contained in:
parent
5c84714d1f
commit
5a9be3d516
@ -172,3 +172,24 @@ func TestSetRoomVisibility(t *testing.T) {
|
||||
assert.NotNil(t, err)
|
||||
assert.NotEqual(t, createroom.VisibilityTypePrivate, room.Visibility())
|
||||
}
|
||||
|
||||
func TestLogoutAll(t *testing.T) {
|
||||
backend := NewBackend("localhost")
|
||||
|
||||
var (
|
||||
userName = "user1"
|
||||
password = "password1"
|
||||
)
|
||||
|
||||
user, _, err := backend.Register(userName, password, "dev1")
|
||||
assert.Nil(t, err)
|
||||
assert.Len(t, user.Devices(), 1)
|
||||
|
||||
_, err = backend.Login(userName, password, "dev2")
|
||||
assert.Nil(t, err)
|
||||
assert.Len(t, user.Devices(), 2)
|
||||
|
||||
user.LogoutAll()
|
||||
|
||||
assert.Len(t, user.Devices(), 0)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user