1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-09 08:42:50 +03:00

Device manager - confirm sign out of other sessions (PSG-921) (#9487)

* change testid attribute for dialog buttons to rtl friendly

* add confirm dialog for signing out sessions

* cleanup commented

* update cypress tets

* clear modals before test

* missing modal in jest tests on ci only
This commit is contained in:
Kerry
2022-10-25 10:39:48 +02:00
committed by GitHub
parent 37e613bb05
commit d473b4ac4a
9 changed files with 174 additions and 84 deletions

View File

@@ -20,7 +20,7 @@ import { mount, ReactWrapper } from 'enzyme';
import { act } from 'react-dom/test-utils';
import { IPassphraseInfo } from 'matrix-js-sdk/src/crypto/api';
import { findByTestId, getMockClientWithEventEmitter, unmockClientPeg } from '../../../test-utils';
import { findByAttr, getMockClientWithEventEmitter, unmockClientPeg } from '../../../test-utils';
import { findById, flushPromises } from '../../../test-utils';
import AccessSecretStorageDialog from "../../../../src/components/views/dialogs/security/AccessSecretStorageDialog";
@@ -91,7 +91,7 @@ describe("AccessSecretStorageDialog", () => {
wrapper.setProps({});
});
const submitButton = findByTestId(wrapper, 'dialog-primary-button').at(0);
const submitButton = findByAttr('data-testid')(wrapper, 'dialog-primary-button').at(0);
// submit button is enabled when key is valid
expect(submitButton.props().disabled).toBeFalsy();
expect(wrapper.find('.mx_AccessSecretStorageDialog_recoveryKeyFeedback').text()).toEqual('Looks good!');
@@ -112,7 +112,7 @@ describe("AccessSecretStorageDialog", () => {
// @ts-ignore private
await wrapper.instance().validateRecoveryKey();
const submitButton = findByTestId(wrapper, 'dialog-primary-button').at(0);
const submitButton = findByAttr('data-testid')(wrapper, 'dialog-primary-button').at(0);
// submit button is disabled when recovery key is invalid
expect(submitButton.props().disabled).toBeTruthy();
expect(