Update e2ee tests

This commit is contained in:
Diego Mello 2024-03-07 15:07:41 -03:00
parent 1dac91b6f5
commit 74b59a305e
2 changed files with 8 additions and 12 deletions

View File

@ -34,7 +34,7 @@ export const EncryptedRoom = ({
}; };
return ( return (
<View style={styles.root}> <View style={styles.root} testID='room-view-encrypted-room'>
<View style={styles.container}> <View style={styles.container}>
<View style={styles.textView}> <View style={styles.textView}>
<View style={styles.icon}> <View style={styles.icon}>

View File

@ -5,14 +5,14 @@ import {
login, login,
sleep, sleep,
tapBack, tapBack,
searchRoom,
logout, logout,
platformTypes, platformTypes,
TTextMatcher, TTextMatcher,
tapAndWaitFor, tapAndWaitFor,
expectValidRegisterOrRetry, expectValidRegisterOrRetry,
mockMessage, mockMessage,
tryTapping tryTapping,
navigateToRoom
} from '../../helpers/app'; } from '../../helpers/app';
import data from '../../data'; import data from '../../data';
import { createRandomUser, deleteCreatedUsers, IDeleteCreateUser, ITestUser } from '../../helpers/data_setup'; import { createRandomUser, deleteCreatedUsers, IDeleteCreateUser, ITestUser } from '../../helpers/data_setup';
@ -40,14 +40,6 @@ const checkBanner = async () => {
.withTimeout(10000); .withTimeout(10000);
}; };
async function navigateToRoom(roomName: string) {
await searchRoom(`${roomName}`);
await element(by.id(`rooms-list-view-item-${roomName}`)).tap();
await waitFor(element(by.id('room-view')))
.toBeVisible()
.withTimeout(5000);
}
async function waitForToast() { async function waitForToast() {
await sleep(300); await sleep(300);
} }
@ -298,7 +290,9 @@ describe('E2E Encryption', () => {
await waitFor(element(by[textMatcher](mockedMessageText)).atIndex(0)) await waitFor(element(by[textMatcher](mockedMessageText)).atIndex(0))
.not.toExist() .not.toExist()
.withTimeout(2000); .withTimeout(2000);
await expect(element(by.label('Encrypted message')).atIndex(0)).toExist(); await waitFor(element(by.id('room-view-encrypted-room')))
.toBeVisible()
.withTimeout(2000);
}); });
it('should enter new e2e password and messages should be decrypted', async () => { it('should enter new e2e password and messages should be decrypted', async () => {
@ -431,4 +425,6 @@ describe('E2E Encryption', () => {
await checkBanner(); await checkBanner();
}); });
}); });
// TODO: missing request e2ee room key
}); });