Fix accept gv2 invite test
This commit is contained in:
parent
1e2f80e9f9
commit
012e771fc2
3 changed files with 19 additions and 2 deletions
|
@ -170,6 +170,7 @@ export function ModalPage({
|
||||||
i18n,
|
i18n,
|
||||||
modalFooter,
|
modalFooter,
|
||||||
modalHeaderChildren,
|
modalHeaderChildren,
|
||||||
|
modalName,
|
||||||
moduleClassName,
|
moduleClassName,
|
||||||
onBackButtonClick,
|
onBackButtonClick,
|
||||||
onClose,
|
onClose,
|
||||||
|
@ -220,6 +221,7 @@ export function ModalPage({
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
aria-labelledby={title ? `${id}-title` : undefined}
|
aria-labelledby={title ? `${id}-title` : undefined}
|
||||||
aria-describedby={ariaDescribedBy}
|
aria-describedby={ariaDescribedBy}
|
||||||
|
data-testid={modalName}
|
||||||
onClick={event => {
|
onClick={event => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -76,7 +76,10 @@ export function useAnimated(
|
||||||
useChain(shouldShowModal ? [overlayRef, modalRef] : [modalRef, overlayRef]);
|
useChain(shouldShowModal ? [overlayRef, modalRef] : [modalRef, overlayRef]);
|
||||||
const close = useCallback(() => {
|
const close = useCallback(() => {
|
||||||
setState(currentState => {
|
setState(currentState => {
|
||||||
if (currentState === ModalState.Open) {
|
if (
|
||||||
|
currentState === ModalState.Open ||
|
||||||
|
currentState === ModalState.Opening
|
||||||
|
) {
|
||||||
return ModalState.Closing;
|
return ModalState.Closing;
|
||||||
}
|
}
|
||||||
return currentState;
|
return currentState;
|
||||||
|
|
|
@ -163,7 +163,14 @@ describe('pnp/accept gv2 invite', function (this: Mocha.Suite) {
|
||||||
.locator('.conversation-details-panel >> "Leave group"')
|
.locator('.conversation-details-panel >> "Leave group"')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
await window.locator('.module-Modal button >> "Leave"').click();
|
await window
|
||||||
|
.getByTestId('ConfirmationDialog.ConversationDetailsAction.confirmLeave')
|
||||||
|
.getByRole('button', { name: 'Leave' })
|
||||||
|
.click();
|
||||||
|
|
||||||
|
debug('Get back to timeline');
|
||||||
|
|
||||||
|
await window.locator('.ConversationPanel__header__back-button').click();
|
||||||
|
|
||||||
debug('Waiting for final group update');
|
debug('Waiting for final group update');
|
||||||
group = await phone.waitForGroupUpdate(group);
|
group = await phone.waitForGroupUpdate(group);
|
||||||
|
@ -173,6 +180,11 @@ describe('pnp/accept gv2 invite', function (this: Mocha.Suite) {
|
||||||
assert(!group.getMemberByServiceId(desktop.pni));
|
assert(!group.getMemberByServiceId(desktop.pni));
|
||||||
assert(!group.getPendingMemberByServiceId(desktop.aci));
|
assert(!group.getPendingMemberByServiceId(desktop.aci));
|
||||||
assert(group.getPendingMemberByServiceId(desktop.pni));
|
assert(group.getPendingMemberByServiceId(desktop.pni));
|
||||||
|
|
||||||
|
debug('Waiting for notification');
|
||||||
|
await window
|
||||||
|
.locator('.SystemMessage:has-text("You left the group")')
|
||||||
|
.waitFor();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should decline PNI invite and modify the group state', async () => {
|
it('should decline PNI invite and modify the group state', async () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue