Skip to content

Commit

Permalink
Update e2ee tests
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello committed Mar 7, 2024
1 parent 1dac91b commit a4d6305
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/views/RoomView/components/EncryptedRoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const EncryptedRoom = ({
};

return (
<View style={styles.root}>
<View style={styles.root} testID='room-view-encrypted-room'>
<View style={styles.container}>
<View style={styles.textView}>
<View style={styles.icon}>
Expand Down
17 changes: 7 additions & 10 deletions e2e/tests/assorted/01-e2eencryption.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
tapAndWaitFor,
expectValidRegisterOrRetry,
mockMessage,
tryTapping
tryTapping,
navigateToRoom
} from '../../helpers/app';
import data from '../../data';
import { createRandomUser, deleteCreatedUsers, IDeleteCreateUser, ITestUser } from '../../helpers/data_setup';
Expand Down Expand Up @@ -40,14 +41,6 @@ const checkBanner = async () => {
.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() {
await sleep(300);
}
Expand Down Expand Up @@ -298,7 +291,9 @@ describe('E2E Encryption', () => {
await waitFor(element(by[textMatcher](mockedMessageText)).atIndex(0))
.not.toExist()
.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 () => {
Expand Down Expand Up @@ -431,4 +426,6 @@ describe('E2E Encryption', () => {
await checkBanner();
});
});

// TODO: missing request e2ee room key
});

0 comments on commit a4d6305

Please sign in to comment.