Fix flaky GV2 mock test
This commit is contained in:
parent
0a24ca8d88
commit
50100906f3
1 changed files with 16 additions and 13 deletions
|
@ -17,13 +17,14 @@ describe('gv2', function needsName() {
|
||||||
|
|
||||||
let bootstrap: Bootstrap;
|
let bootstrap: Bootstrap;
|
||||||
let app: App;
|
let app: App;
|
||||||
|
let aciContact: PrimaryDevice;
|
||||||
let pniContact: PrimaryDevice;
|
let pniContact: PrimaryDevice;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
bootstrap = new Bootstrap();
|
bootstrap = new Bootstrap();
|
||||||
await bootstrap.init();
|
await bootstrap.init();
|
||||||
|
|
||||||
const { phone, contacts, server } = bootstrap;
|
const { phone, server } = bootstrap;
|
||||||
|
|
||||||
let state = StorageState.getEmpty();
|
let state = StorageState.getEmpty();
|
||||||
|
|
||||||
|
@ -32,17 +33,19 @@ describe('gv2', function needsName() {
|
||||||
e164: phone.device.number,
|
e164: phone.device.number,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [first] = contacts;
|
aciContact = await server.createPrimaryDevice({
|
||||||
state = state.addContact(first, {
|
profileName: 'ACI Contact',
|
||||||
|
});
|
||||||
|
state = state.addContact(aciContact, {
|
||||||
identityState: Proto.ContactRecord.IdentityState.VERIFIED,
|
identityState: Proto.ContactRecord.IdentityState.VERIFIED,
|
||||||
whitelisted: true,
|
whitelisted: true,
|
||||||
|
|
||||||
identityKey: first.publicKey.serialize(),
|
identityKey: aciContact.publicKey.serialize(),
|
||||||
profileKey: first.profileKey.serialize(),
|
profileKey: aciContact.profileKey.serialize(),
|
||||||
});
|
});
|
||||||
|
|
||||||
pniContact = await server.createPrimaryDevice({
|
pniContact = await server.createPrimaryDevice({
|
||||||
profileName: 'My name is PNI',
|
profileName: 'My profile is a secret',
|
||||||
});
|
});
|
||||||
state = state.addContact(pniContact, {
|
state = state.addContact(pniContact, {
|
||||||
identityState: Proto.ContactRecord.IdentityState.VERIFIED,
|
identityState: Proto.ContactRecord.IdentityState.VERIFIED,
|
||||||
|
@ -66,8 +69,7 @@ describe('gv2', function needsName() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create group and modify it', async () => {
|
it('should create group and modify it', async () => {
|
||||||
const { phone, contacts } = bootstrap;
|
const { phone } = bootstrap;
|
||||||
const [first] = contacts;
|
|
||||||
|
|
||||||
let state = await phone.expectStorageState('initial state');
|
let state = await phone.expectStorageState('initial state');
|
||||||
|
|
||||||
|
@ -87,17 +89,18 @@ describe('gv2', function needsName() {
|
||||||
debug('inviting ACI member');
|
debug('inviting ACI member');
|
||||||
|
|
||||||
await leftPane
|
await leftPane
|
||||||
.locator(
|
.locator('.module-left-pane__compose-search-form__input')
|
||||||
'_react=BaseConversationListItem' +
|
.fill('ACI');
|
||||||
`[title = ${JSON.stringify(first.profileName)}]`
|
|
||||||
)
|
await leftPane
|
||||||
|
.locator('_react=BaseConversationListItem[title = "ACI Contact"]')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
debug('inviting PNI member');
|
debug('inviting PNI member');
|
||||||
|
|
||||||
await leftPane
|
await leftPane
|
||||||
.locator('.module-left-pane__compose-search-form__input')
|
.locator('.module-left-pane__compose-search-form__input')
|
||||||
.type('PNI');
|
.fill('PNI');
|
||||||
|
|
||||||
await leftPane
|
await leftPane
|
||||||
.locator('_react=BaseConversationListItem[title = "PNI Contact"]')
|
.locator('_react=BaseConversationListItem[title = "PNI Contact"]')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue