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:
@@ -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(
|
||||
|
||||
@@ -65,8 +65,8 @@ describe('<ExportDialog />', () => {
|
||||
const getAttachmentsCheckbox = (component) => component.find('input[id="include-attachments"]');
|
||||
const getMessageCountInput = (component) => component.find('input[id="message-count"]');
|
||||
const getExportFormatInput = (component, format) => component.find(`input[id="exportFormat-${format}"]`);
|
||||
const getPrimaryButton = (component) => component.find('[data-test-id="dialog-primary-button"]');
|
||||
const getSecondaryButton = (component) => component.find('[data-test-id="dialog-cancel-button"]');
|
||||
const getPrimaryButton = (component) => component.find('[data-testid="dialog-primary-button"]');
|
||||
const getSecondaryButton = (component) => component.find('[data-testid="dialog-cancel-button"]');
|
||||
|
||||
const submitForm = async (component) => act(async () => {
|
||||
getPrimaryButton(component).simulate('click');
|
||||
|
||||
@@ -111,14 +111,14 @@ exports[`<ChangelogDialog /> should fetch github proxy url for each repo with ol
|
||||
class="mx_Dialog_buttons_row"
|
||||
>
|
||||
<button
|
||||
data-test-id="dialog-cancel-button"
|
||||
data-testid="dialog-cancel-button"
|
||||
type="button"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
class="mx_Dialog_primary"
|
||||
data-test-id="dialog-primary-button"
|
||||
data-testid="dialog-primary-button"
|
||||
type="button"
|
||||
>
|
||||
Update
|
||||
|
||||
@@ -249,14 +249,14 @@ Array [
|
||||
class="mx_Dialog_buttons_row"
|
||||
>
|
||||
<button
|
||||
data-test-id="dialog-cancel-button"
|
||||
data-testid="dialog-cancel-button"
|
||||
type="button"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
class="mx_Dialog_primary"
|
||||
data-test-id="dialog-primary-button"
|
||||
data-testid="dialog-primary-button"
|
||||
type="button"
|
||||
>
|
||||
Export
|
||||
@@ -474,14 +474,14 @@ Array [
|
||||
class="mx_Dialog_buttons_row"
|
||||
>
|
||||
<button
|
||||
data-test-id="dialog-cancel-button"
|
||||
data-testid="dialog-cancel-button"
|
||||
type="button"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
class="mx_Dialog_primary"
|
||||
data-test-id="dialog-primary-button"
|
||||
data-testid="dialog-primary-button"
|
||||
type="button"
|
||||
>
|
||||
Export
|
||||
@@ -827,7 +827,7 @@ Array [
|
||||
className="mx_Dialog_buttons_row"
|
||||
>
|
||||
<button
|
||||
data-test-id="dialog-cancel-button"
|
||||
data-testid="dialog-cancel-button"
|
||||
disabled={false}
|
||||
onClick={[Function]}
|
||||
type="button"
|
||||
@@ -836,7 +836,7 @@ Array [
|
||||
</button>
|
||||
<button
|
||||
className="mx_Dialog_primary"
|
||||
data-test-id="dialog-primary-button"
|
||||
data-testid="dialog-primary-button"
|
||||
onClick={[Function]}
|
||||
type="button"
|
||||
>
|
||||
@@ -1102,14 +1102,14 @@ Array [
|
||||
class="mx_Dialog_buttons_row"
|
||||
>
|
||||
<button
|
||||
data-test-id="dialog-cancel-button"
|
||||
data-testid="dialog-cancel-button"
|
||||
type="button"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
class="mx_Dialog_primary"
|
||||
data-test-id="dialog-primary-button"
|
||||
data-testid="dialog-primary-button"
|
||||
type="button"
|
||||
>
|
||||
Export
|
||||
@@ -1327,14 +1327,14 @@ Array [
|
||||
class="mx_Dialog_buttons_row"
|
||||
>
|
||||
<button
|
||||
data-test-id="dialog-cancel-button"
|
||||
data-testid="dialog-cancel-button"
|
||||
type="button"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
class="mx_Dialog_primary"
|
||||
data-test-id="dialog-primary-button"
|
||||
data-testid="dialog-primary-button"
|
||||
type="button"
|
||||
>
|
||||
Export
|
||||
@@ -1680,7 +1680,7 @@ Array [
|
||||
className="mx_Dialog_buttons_row"
|
||||
>
|
||||
<button
|
||||
data-test-id="dialog-cancel-button"
|
||||
data-testid="dialog-cancel-button"
|
||||
disabled={false}
|
||||
onClick={[Function]}
|
||||
type="button"
|
||||
@@ -1689,7 +1689,7 @@ Array [
|
||||
</button>
|
||||
<button
|
||||
className="mx_Dialog_primary"
|
||||
data-test-id="dialog-primary-button"
|
||||
data-testid="dialog-primary-button"
|
||||
onClick={[Function]}
|
||||
type="button"
|
||||
>
|
||||
@@ -1942,14 +1942,14 @@ Array [
|
||||
class="mx_Dialog_buttons_row"
|
||||
>
|
||||
<button
|
||||
data-test-id="dialog-cancel-button"
|
||||
data-testid="dialog-cancel-button"
|
||||
type="button"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
class="mx_Dialog_primary"
|
||||
data-test-id="dialog-primary-button"
|
||||
data-testid="dialog-primary-button"
|
||||
type="button"
|
||||
>
|
||||
Export
|
||||
@@ -2167,14 +2167,14 @@ Array [
|
||||
class="mx_Dialog_buttons_row"
|
||||
>
|
||||
<button
|
||||
data-test-id="dialog-cancel-button"
|
||||
data-testid="dialog-cancel-button"
|
||||
type="button"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
class="mx_Dialog_primary"
|
||||
data-test-id="dialog-primary-button"
|
||||
data-testid="dialog-primary-button"
|
||||
type="button"
|
||||
>
|
||||
Export
|
||||
@@ -2520,7 +2520,7 @@ Array [
|
||||
className="mx_Dialog_buttons_row"
|
||||
>
|
||||
<button
|
||||
data-test-id="dialog-cancel-button"
|
||||
data-testid="dialog-cancel-button"
|
||||
disabled={false}
|
||||
onClick={[Function]}
|
||||
type="button"
|
||||
@@ -2529,7 +2529,7 @@ Array [
|
||||
</button>
|
||||
<button
|
||||
className="mx_Dialog_primary"
|
||||
data-test-id="dialog-primary-button"
|
||||
data-testid="dialog-primary-button"
|
||||
onClick={[Function]}
|
||||
type="button"
|
||||
>
|
||||
@@ -2873,7 +2873,7 @@ Array [
|
||||
className="mx_Dialog_buttons_row"
|
||||
>
|
||||
<button
|
||||
data-test-id="dialog-cancel-button"
|
||||
data-testid="dialog-cancel-button"
|
||||
disabled={false}
|
||||
onClick={[Function]}
|
||||
type="button"
|
||||
@@ -2882,7 +2882,7 @@ Array [
|
||||
</button>
|
||||
<button
|
||||
className="mx_Dialog_primary"
|
||||
data-test-id="dialog-primary-button"
|
||||
data-testid="dialog-primary-button"
|
||||
onClick={[Function]}
|
||||
type="button"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user