improve testing after adding threema support for typing

This commit is contained in:
Martin/Geno 2019-06-06 22:33:24 +02:00
parent 0bd92ec5c3
commit b72998ae4b
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
1 changed files with 22 additions and 0 deletions

View File

@ -150,3 +150,25 @@ func TestReceiveDeliveryReceipt(t *testing.T) {
assert.NoError(err)
assert.Nil(p)
}
func TestReceiveTyping(t *testing.T) {
assert := assert.New(t)
a := createDummyAccount()
// receiving inactive
tnm := o3.TypingNotificationMessage{}
p, err := a.receiving(tnm)
assert.NoError(err)
xMSG, ok := p.(xmpp.Message)
assert.True(ok)
assert.IsType(xmpp.StateInactive{}, xMSG.Extensions[0])
// receiving composing
tnm = o3.TypingNotificationMessage{}
tnm.OnOff = 0x1
p, err = a.receiving(tnm)
assert.NoError(err)
xMSG, ok = p.(xmpp.Message)
assert.True(ok)
assert.IsType(xmpp.StateComposing{}, xMSG.Extensions[0])
}