Updated tests to include tests on IdentityImage.Encrypted state

This commit is contained in:
Samuel Hawksby-Robinson 2021-02-12 15:55:34 +00:00 committed by Andrea Maria Piana
parent 1534fc15c9
commit 33487d64de
1 changed files with 8 additions and 0 deletions

View File

@ -2604,6 +2604,8 @@ func (s *MessengerSuite) TestEncryptDecryptIdentityImagesWithContactPubKeys() {
}
s.Require().NotEqual([]byte(smPayload), ci.Images["small"].Payload)
s.Require().NotEqual([]byte(lgPayload), ci.Images["large"].Payload)
s.Require().True(ci.Images["small"].Encrypted)
s.Require().True(ci.Images["large"].Encrypted)
// Switch messenger identities
sender := s.m.identity
@ -2615,6 +2617,8 @@ func (s *MessengerSuite) TestEncryptDecryptIdentityImagesWithContactPubKeys() {
s.Require().Equal(smPayload, string(ci.Images["small"].Payload))
s.Require().Equal(lgPayload, string(ci.Images["large"].Payload))
s.Require().False(ci.Images["small"].Encrypted)
s.Require().False(ci.Images["large"].Encrypted)
// RESET Messenger identity, Contacts and IdentityImage.EncryptionKeys
s.m.identity = sender
@ -2631,6 +2635,8 @@ func (s *MessengerSuite) TestEncryptDecryptIdentityImagesWithContactPubKeys() {
}
s.Require().NotEqual([]byte(smPayload), ci.Images["small"].Payload)
s.Require().NotEqual([]byte(lgPayload), ci.Images["large"].Payload)
s.Require().True(ci.Images["small"].Encrypted)
s.Require().True(ci.Images["large"].Encrypted)
// Switch messenger identities
s.m.identity = contactKeys[2]
@ -2641,6 +2647,8 @@ func (s *MessengerSuite) TestEncryptDecryptIdentityImagesWithContactPubKeys() {
s.Require().NotEqual([]byte(smPayload), ci.Images["small"].Payload)
s.Require().NotEqual([]byte(lgPayload), ci.Images["large"].Payload)
s.Require().True(ci.Images["small"].Encrypted)
s.Require().True(ci.Images["large"].Encrypted)
// RESET Messenger identity
s.m.identity = sender