Introduce TitleTransition notification

This commit is contained in:
Fedor Indutny 2024-03-06 15:59:51 -08:00 committed by GitHub
parent 09b5e6ef50
commit 3469a748fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 336 additions and 51 deletions

View file

@ -93,7 +93,15 @@ describe('pnp/username', function (this: Mocha.Suite) {
.locator(
`[data-testid="${usernameContact.device.aci}"] >> "${USERNAME}"`
)
.waitFor();
.click();
debug('Send message to username');
{
const compositionInput = await app.waitForEnabledComposer();
await compositionInput.type('Hello username');
await compositionInput.press('Enter');
}
let state = await phone.expectStorageState('consistency check');
@ -141,6 +149,31 @@ describe('pnp/username', function (this: Mocha.Suite) {
assert.strictEqual(removed[0].contact?.aci, usernameContact.device.aci);
assert.strictEqual(removed[0].contact?.username, USERNAME);
}
if (type === 'system') {
// No notifications
const notifications = window.locator('.SystemMessage');
assert.strictEqual(
await notifications.count(),
0,
'notification count'
);
} else {
// One notification - the username transition
const notifications = window.locator('.SystemMessage');
await notifications.waitFor();
assert.strictEqual(
await notifications.count(),
1,
'notification count'
);
const first = await notifications.first();
assert.strictEqual(
await first.innerText(),
`You started this chat with ${USERNAME}`
);
}
});
}