diff --git a/src/routes/safe/components/Settings/ChangeSafeName/index.jsx b/src/routes/safe/components/Settings/ChangeSafeName/index.jsx index 1908f5a8..7b2c1da7 100644 --- a/src/routes/safe/components/Settings/ChangeSafeName/index.jsx +++ b/src/routes/safe/components/Settings/ChangeSafeName/index.jsx @@ -20,8 +20,8 @@ const controlsStyle = { padding: sm, } -export const SAFE_NAME_INPUT_TESTID = 'safe-name-input' -export const SAFE_NAME_SUBMIT_BTN_TESTID = 'change-safe-name-btn' +export const SAFE_NAME_INPUT_TEST_ID = 'safe-name-input' +export const SAFE_NAME_SUBMIT_BTN_TEST_ID = 'change-safe-name-btn' type Props = { classes: Object, @@ -59,7 +59,7 @@ const ChangeSafeName = (props: Props) => { placeholder="Safe name*" text="Safe name*" defaultValue={safeName} - testId={SAFE_NAME_INPUT_TESTID} + testId={SAFE_NAME_INPUT_TEST_ID} /> @@ -72,7 +72,7 @@ const ChangeSafeName = (props: Props) => { size="small" variant="contained" color="primary" - testId={SAFE_NAME_SUBMIT_BTN_TESTID} + testId={SAFE_NAME_SUBMIT_BTN_TEST_ID} > SAVE diff --git a/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/OwnerForm/index.jsx b/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/OwnerForm/index.jsx index f661110f..cc9bd302 100644 --- a/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/OwnerForm/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/OwnerForm/index.jsx @@ -23,9 +23,9 @@ import { } from '~/components/forms/validator' import { styles } from './style' -export const ADD_OWNER_NAME_INPUT_TESTID = 'add-owner-name-input' -export const ADD_OWNER_ADDRESS_INPUT_TESTID = 'add-owner-address-testid' -export const ADD_OWNER_NEXT_BTN_TESTID = 'add-owner-next-btn' +export const ADD_OWNER_NAME_INPUT_TEST_ID = 'add-owner-name-input' +export const ADD_OWNER_ADDRESS_INPUT_TEST_ID = 'add-owner-address-testid' +export const ADD_OWNER_NEXT_BTN_TEST_ID = 'add-owner-next-btn' type Props = { onClose: () => void, @@ -71,7 +71,7 @@ const OwnerForm = ({ placeholder="Owner name*" text="Owner name*" className={classes.addressInput} - testId={ADD_OWNER_NAME_INPUT_TESTID} + testId={ADD_OWNER_NAME_INPUT_TEST_ID} /> @@ -85,7 +85,7 @@ const OwnerForm = ({ placeholder="Owner address*" text="Owner address*" className={classes.addressInput} - testId={ADD_OWNER_ADDRESS_INPUT_TESTID} + testId={ADD_OWNER_ADDRESS_INPUT_TEST_ID} /> @@ -101,7 +101,7 @@ const OwnerForm = ({ variant="contained" minWidth={140} color="primary" - testId={ADD_OWNER_NEXT_BTN_TESTID} + testId={ADD_OWNER_NEXT_BTN_TEST_ID} > Next diff --git a/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/Review/index.jsx b/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/Review/index.jsx index 1e525d81..25217f5b 100644 --- a/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/Review/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/Review/index.jsx @@ -19,7 +19,7 @@ import { getEtherScanLink } from '~/logic/wallets/getWeb3' import { secondary } from '~/theme/variables' import { styles } from './style' -export const ADD_OWNER_SUBMIT_BTN_TESTID = 'add-owner-submit-btn' +export const ADD_OWNER_SUBMIT_BTN_TEST_ID = 'add-owner-submit-btn' const openIconStyle = { height: '16px', @@ -164,7 +164,7 @@ const ReviewAddOwner = ({ variant="contained" minWidth={140} color="primary" - testId={ADD_OWNER_SUBMIT_BTN_TESTID} + testId={ADD_OWNER_SUBMIT_BTN_TEST_ID} > Submit diff --git a/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/ThresholdForm/index.jsx b/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/ThresholdForm/index.jsx index 3cb584eb..b31127d3 100644 --- a/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/ThresholdForm/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/ThresholdForm/index.jsx @@ -20,7 +20,7 @@ import { } from '~/components/forms/validator' import { styles } from './style' -export const ADD_OWNER_THRESHOLD_NEXT_BTN_TESTID = 'add-owner-threshold-next-btn' +export const ADD_OWNER_THRESHOLD_NEXT_BTN_TEST_ID = 'add-owner-threshold-next-btn' type Props = { onClose: () => void, @@ -110,7 +110,7 @@ owner(s) variant="contained" minWidth={140} color="primary" - testId={ADD_OWNER_THRESHOLD_NEXT_BTN_TESTID} + testId={ADD_OWNER_THRESHOLD_NEXT_BTN_TEST_ID} > Review diff --git a/src/routes/safe/components/Settings/ManageOwners/EditOwnerModal/index.jsx b/src/routes/safe/components/Settings/ManageOwners/EditOwnerModal/index.jsx index 488a7ece..2eb99b13 100644 --- a/src/routes/safe/components/Settings/ManageOwners/EditOwnerModal/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/EditOwnerModal/index.jsx @@ -20,8 +20,8 @@ import Modal from '~/components/Modal' import { styles } from './style' import { secondary } from '~/theme/variables' -export const RENAME_OWNER_INPUT_TESTID = 'rename-owner-input' -export const SAVE_OWNER_CHANGES_BTN_TESTID = 'save-owner-changes-btn' +export const RENAME_OWNER_INPUT_TEST_ID = 'rename-owner-input' +export const SAVE_OWNER_CHANGES_BTN_TEST_ID = 'save-owner-changes-btn' const openIconStyle = { height: '16px', @@ -85,7 +85,7 @@ const EditOwnerComponent = ({ text="Owner name*" initialValue={selectedOwnerName} className={classes.addressInput} - testId={RENAME_OWNER_INPUT_TESTID} + testId={RENAME_OWNER_INPUT_TEST_ID} /> @@ -105,7 +105,7 @@ const EditOwnerComponent = ({ - diff --git a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/CheckOwner/index.jsx b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/CheckOwner/index.jsx index 32e48b5f..b23c4386 100644 --- a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/CheckOwner/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/CheckOwner/index.jsx @@ -17,7 +17,7 @@ import { getEtherScanLink } from '~/logic/wallets/getWeb3' import { styles } from './style' import { secondary } from '~/theme/variables' -export const REMOVE_OWNER_MODAL_NEXT_BTN_TESTID = 'remove-owner-next-btn' +export const REMOVE_OWNER_MODAL_NEXT_BTN_TEST_ID = 'remove-owner-next-btn' const openIconStyle = { height: '16px', @@ -95,7 +95,7 @@ const CheckOwner = ({ minWidth={140} color="primary" onClick={handleSubmit} - testId={REMOVE_OWNER_MODAL_NEXT_BTN_TESTID} + testId={REMOVE_OWNER_MODAL_NEXT_BTN_TEST_ID} > Next diff --git a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/Review/index.jsx b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/Review/index.jsx index 1e22b4a0..e5e7921e 100644 --- a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/Review/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/Review/index.jsx @@ -19,7 +19,7 @@ import { getEtherScanLink } from '~/logic/wallets/getWeb3' import { secondary } from '~/theme/variables' import { styles } from './style' -export const REMOVE_OWNER_REVIEW_BTN_TESTID = 'remove-owner-review-btn' +export const REMOVE_OWNER_REVIEW_BTN_TEST_ID = 'remove-owner-review-btn' const openIconStyle = { height: '16px', @@ -182,7 +182,7 @@ const ReviewRemoveOwner = ({ variant="contained" minWidth={140} color="primary" - testId={REMOVE_OWNER_REVIEW_BTN_TESTID} + testId={REMOVE_OWNER_REVIEW_BTN_TEST_ID} > Submit diff --git a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/ThresholdForm/index.jsx b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/ThresholdForm/index.jsx index 56f118f3..73667ea8 100644 --- a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/ThresholdForm/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/ThresholdForm/index.jsx @@ -20,7 +20,7 @@ import { } from '~/components/forms/validator' import { styles } from './style' -export const REMOVE_OWNER_THRESHOLD_NEXT_BTN_TESTID = 'remove-owner-threshold-next-btn' +export const REMOVE_OWNER_THRESHOLD_NEXT_BTN_TEST_ID = 'remove-owner-threshold-next-btn' type Props = { onClose: () => void, @@ -114,7 +114,7 @@ owner(s) variant="contained" minWidth={140} color="primary" - data-testid={REMOVE_OWNER_THRESHOLD_NEXT_BTN_TESTID} + data-testid={REMOVE_OWNER_THRESHOLD_NEXT_BTN_TEST_ID} > Review diff --git a/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/OwnerForm/index.jsx b/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/OwnerForm/index.jsx index 9dcdf8a6..623d856c 100644 --- a/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/OwnerForm/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/OwnerForm/index.jsx @@ -29,9 +29,9 @@ import { import { styles } from './style' import { secondary } from '~/theme/variables' -export const REPLACE_OWNER_NAME_INPUT_TESTID = 'replace-owner-name-input' -export const REPLACE_OWNER_ADDRESS_INPUT_TESTID = 'replace-owner-address-testid' -export const REPLACE_OWNER_NEXT_BTN_TESTID = 'replace-owner-next-btn' +export const REPLACE_OWNER_NAME_INPUT_TEST_ID = 'replace-owner-name-input' +export const REPLACE_OWNER_ADDRESS_INPUT_TEST_ID = 'replace-owner-address-testid' +export const REPLACE_OWNER_NEXT_BTN_TEST_ID = 'replace-owner-next-btn' const openIconStyle = { height: '16px', @@ -114,7 +114,7 @@ const OwnerForm = ({ placeholder="Owner name*" text="Owner name*" className={classes.addressInput} - testId={REPLACE_OWNER_NAME_INPUT_TESTID} + testId={REPLACE_OWNER_NAME_INPUT_TEST_ID} /> @@ -128,7 +128,7 @@ const OwnerForm = ({ placeholder="Owner address*" text="Owner address*" className={classes.addressInput} - testId={REPLACE_OWNER_ADDRESS_INPUT_TESTID} + testId={REPLACE_OWNER_ADDRESS_INPUT_TEST_ID} /> @@ -144,7 +144,7 @@ const OwnerForm = ({ variant="contained" minWidth={140} color="primary" - testId={REPLACE_OWNER_NEXT_BTN_TESTID} + testId={REPLACE_OWNER_NEXT_BTN_TEST_ID} > Next diff --git a/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/Review/index.jsx b/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/Review/index.jsx index d5adbcd7..6d499962 100644 --- a/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/Review/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/Review/index.jsx @@ -19,7 +19,7 @@ import { getEtherScanLink } from '~/logic/wallets/getWeb3' import { secondary } from '~/theme/variables' import { styles } from './style' -export const REPLACE_OWNER_SUBMIT_BTN_TESTID = 'replace-owner-submit-btn' +export const REPLACE_OWNER_SUBMIT_BTN_TEST_ID = 'replace-owner-submit-btn' const openIconStyle = { height: '16px', @@ -210,7 +210,7 @@ const ReviewRemoveOwner = ({ variant="contained" minWidth={140} color="primary" - testId={REPLACE_OWNER_SUBMIT_BTN_TESTID} + testId={REPLACE_OWNER_SUBMIT_BTN_TEST_ID} > Submit diff --git a/src/routes/safe/components/Settings/ManageOwners/index.jsx b/src/routes/safe/components/Settings/ManageOwners/index.jsx index a02e815a..bc912b8d 100644 --- a/src/routes/safe/components/Settings/ManageOwners/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/index.jsx @@ -28,11 +28,11 @@ import ReplaceOwnerIcon from './assets/icons/replace-owner.svg' import RenameOwnerIcon from './assets/icons/rename-owner.svg' import RemoveOwnerIcon from '../assets/icons/bin.svg' -export const RENAME_OWNER_BTN_TESTID = 'rename-owner-btn' -export const REMOVE_OWNER_BTN_TESTID = 'remove-owner-btn' -export const ADD_OWNER_BTN_TESTID = 'add-owner-btn' -export const REPLACE_OWNER_BTN_TESTID = 'replace-owner-btn' -export const OWNERS_ROW_TESTID = 'owners-row' +export const RENAME_OWNER_BTN_TEST_ID = 'rename-owner-btn' +export const REMOVE_OWNER_BTN_TEST_ID = 'remove-owner-btn' +export const ADD_OWNER_BTN_TEST_ID = 'add-owner-btn' +export const REPLACE_OWNER_BTN_TEST_ID = 'replace-owner-btn' +export const OWNERS_ROW_TEST_ID = 'owners-row' const controlsStyle = { backgroundColor: 'white', @@ -144,7 +144,7 @@ class ManageOwners extends React.Component { noBorder > {(sortedData: Array) => sortedData.map((row: any, index: number) => ( - + {autoColumns.map((column: Column) => ( {column.id === OWNERS_TABLE_ADDRESS_ID ? ( @@ -162,14 +162,14 @@ class ManageOwners extends React.Component { className={classes.editOwnerIcon} src={RenameOwnerIcon} onClick={this.onShow('EditOwner', row)} - testId={RENAME_OWNER_BTN_TESTID} + testId={RENAME_OWNER_BTN_TEST_ID} /> Replace owner {ownerData.size > 1 && ( { className={classes.removeOwnerIcon} src={RemoveOwnerIcon} onClick={this.onShow('RemoveOwner', row)} - testId={REMOVE_OWNER_BTN_TESTID} + testId={REMOVE_OWNER_BTN_TEST_ID} /> )} @@ -199,7 +199,7 @@ class ManageOwners extends React.Component { variant="contained" color="primary" onClick={this.onShow('AddOwner')} - testId={ADD_OWNER_BTN_TESTID} + testId={ADD_OWNER_BTN_TEST_ID} > Add new owner diff --git a/src/routes/safe/components/Settings/index.jsx b/src/routes/safe/components/Settings/index.jsx index e7bd0de7..cd2724a2 100644 --- a/src/routes/safe/components/Settings/index.jsx +++ b/src/routes/safe/components/Settings/index.jsx @@ -20,7 +20,7 @@ import actions, { type Actions } from './actions' import { styles } from './style' import RemoveSafeIcon from './assets/icons/bin.svg' -export const OWNERS_SETTINGS_TAB_TESTID = 'owner-settings-tab' +export const OWNERS_SETTINGS_TAB_TEST_ID = 'owner-settings-tab' type State = { showRemoveSafe: boolean, @@ -121,7 +121,7 @@ class Settings extends React.Component { Owners ( {owners.size} diff --git a/src/test/safe.dom.settings.name.test.js b/src/test/safe.dom.settings.name.test.js index 57acde85..63ce90f3 100644 --- a/src/test/safe.dom.settings.name.test.js +++ b/src/test/safe.dom.settings.name.test.js @@ -5,8 +5,8 @@ import { aMinedSafe } from '~/test/builder/safe.redux.builder' import { renderSafeView } from '~/test/builder/safe.dom.utils' import { sleep } from '~/utils/timer' import '@testing-library/jest-dom/extend-expect' -import { SETTINGS_TAB_BTN_TESTID, SAFE_VIEW_NAME_HEADING_TESTID } from '~/routes/safe/components/Layout' -import { SAFE_NAME_INPUT_TESTID, SAFE_NAME_SUBMIT_BTN_TESTID } from '~/routes/safe/components/Settings/ChangeSafeName' +import { SETTINGS_TAB_BTN_TEST_ID, SAFE_VIEW_NAME_HEADING_TEST_ID } from '~/routes/safe/components/Layout' +import { SAFE_NAME_INPUT_TEST_ID, SAFE_NAME_SUBMIT_BTN_TEST_ID } from '~/routes/safe/components/Settings/ChangeSafeName' afterEach(cleanup) @@ -26,17 +26,17 @@ describe('DOM > Feature > Settings - Name', () => { const SafeDom = renderSafeView(store, safeAddress) await sleep(1300) - const safeNameHeading = SafeDom.getByTestId(SAFE_VIEW_NAME_HEADING_TESTID) + const safeNameHeading = SafeDom.getByTestId(SAFE_VIEW_NAME_HEADING_TEST_ID) expect(safeNameHeading).toHaveTextContent(INITIAL_NAME) // Open settings tab // Safe name setting screen should be pre-selected - const settingsBtn = SafeDom.getByTestId(SETTINGS_TAB_BTN_TESTID) + const settingsBtn = SafeDom.getByTestId(SETTINGS_TAB_BTN_TEST_ID) fireEvent.click(settingsBtn) // Change the name - const safeNameInput = SafeDom.getByTestId(SAFE_NAME_INPUT_TESTID) - const submitBtn = SafeDom.getByTestId(SAFE_NAME_SUBMIT_BTN_TESTID) + const safeNameInput = SafeDom.getByTestId(SAFE_NAME_INPUT_TEST_ID) + const submitBtn = SafeDom.getByTestId(SAFE_NAME_SUBMIT_BTN_TEST_ID) fireEvent.change(safeNameInput, { target: { value: NEW_NAME } }) fireEvent.click(submitBtn) diff --git a/src/test/safe.dom.settings.owners.test.js b/src/test/safe.dom.settings.owners.test.js index 08742cee..f117bb94 100644 --- a/src/test/safe.dom.settings.owners.test.js +++ b/src/test/safe.dom.settings.owners.test.js @@ -5,35 +5,35 @@ import { aMinedSafe } from '~/test/builder/safe.redux.builder' import { renderSafeView } from '~/test/builder/safe.dom.utils' import { sleep } from '~/utils/timer' import '@testing-library/jest-dom/extend-expect' -import { SETTINGS_TAB_BTN_TESTID } from '~/routes/safe/components/Layout' -import { OWNERS_SETTINGS_TAB_TESTID } from '~/routes/safe/components/Settings' +import { SETTINGS_TAB_BTN_TEST_ID } from '~/routes/safe/components/Layout' +import { OWNERS_SETTINGS_TAB_TEST_ID } from '~/routes/safe/components/Settings' import { - RENAME_OWNER_BTN_TESTID, - OWNERS_ROW_TESTID, - REMOVE_OWNER_BTN_TESTID, - ADD_OWNER_BTN_TESTID, - REPLACE_OWNER_BTN_TESTID, + RENAME_OWNER_BTN_TEST_ID, + OWNERS_ROW_TEST_ID, + REMOVE_OWNER_BTN_TEST_ID, + ADD_OWNER_BTN_TEST_ID, + REPLACE_OWNER_BTN_TEST_ID, } from '~/routes/safe/components/Settings/ManageOwners' import { - RENAME_OWNER_INPUT_TESTID, - SAVE_OWNER_CHANGES_BTN_TESTID, + RENAME_OWNER_INPUT_TEST_ID, + SAVE_OWNER_CHANGES_BTN_TEST_ID, } from '~/routes/safe/components/Settings/ManageOwners/EditOwnerModal' -import { REMOVE_OWNER_MODAL_NEXT_BTN_TESTID } from '~/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/CheckOwner' -import { REMOVE_OWNER_THRESHOLD_NEXT_BTN_TESTID } from '~/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/ThresholdForm' -import { REMOVE_OWNER_REVIEW_BTN_TESTID } from '~/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/Review' -import { ADD_OWNER_THRESHOLD_NEXT_BTN_TESTID } from '~/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/ThresholdForm' +import { REMOVE_OWNER_MODAL_NEXT_BTN_TEST_ID } from '~/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/CheckOwner' +import { REMOVE_OWNER_THRESHOLD_NEXT_BTN_TEST_ID } from '~/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/ThresholdForm' +import { REMOVE_OWNER_REVIEW_BTN_TEST_ID } from '~/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/Review' +import { ADD_OWNER_THRESHOLD_NEXT_BTN_TEST_ID } from '~/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/ThresholdForm' import { - ADD_OWNER_NAME_INPUT_TESTID, - ADD_OWNER_ADDRESS_INPUT_TESTID, - ADD_OWNER_NEXT_BTN_TESTID, + ADD_OWNER_NAME_INPUT_TEST_ID, + ADD_OWNER_ADDRESS_INPUT_TEST_ID, + ADD_OWNER_NEXT_BTN_TEST_ID, } from '~/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/OwnerForm' -import { ADD_OWNER_SUBMIT_BTN_TESTID } from '~/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/Review' +import { ADD_OWNER_SUBMIT_BTN_TEST_ID } from '~/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/Review' import { - REPLACE_OWNER_NEXT_BTN_TESTID, - REPLACE_OWNER_NAME_INPUT_TESTID, - REPLACE_OWNER_ADDRESS_INPUT_TESTID, + REPLACE_OWNER_NEXT_BTN_TEST_ID, + REPLACE_OWNER_NAME_INPUT_TEST_ID, + REPLACE_OWNER_ADDRESS_INPUT_TEST_ID, } from '~/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/OwnerForm' -import { REPLACE_OWNER_SUBMIT_BTN_TESTID } from '~/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/Review' +import { REPLACE_OWNER_SUBMIT_BTN_TEST_ID } from '~/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/Review' afterEach(cleanup) @@ -52,28 +52,28 @@ describe('DOM > Feature > Settings - Manage owners', () => { await sleep(1300) // Travel to settings - const settingsBtn = SafeDom.getByTestId(SETTINGS_TAB_BTN_TESTID) + const settingsBtn = SafeDom.getByTestId(SETTINGS_TAB_BTN_TEST_ID) fireEvent.click(settingsBtn) await sleep(200) // click on owners settings - const ownersSettingsBtn = SafeDom.getByTestId(OWNERS_SETTINGS_TAB_TESTID) + const ownersSettingsBtn = SafeDom.getByTestId(OWNERS_SETTINGS_TAB_TEST_ID) fireEvent.click(ownersSettingsBtn) await sleep(200) // open rename owner modal - const renameOwnerBtn = SafeDom.getByTestId(RENAME_OWNER_BTN_TESTID) + const renameOwnerBtn = SafeDom.getByTestId(RENAME_OWNER_BTN_TEST_ID) fireEvent.click(renameOwnerBtn) // rename owner - const ownerNameInput = SafeDom.getByTestId(RENAME_OWNER_INPUT_TESTID) - const saveOwnerChangesBtn = SafeDom.getByTestId(SAVE_OWNER_CHANGES_BTN_TESTID) + const ownerNameInput = SafeDom.getByTestId(RENAME_OWNER_INPUT_TEST_ID) + const saveOwnerChangesBtn = SafeDom.getByTestId(SAVE_OWNER_CHANGES_BTN_TEST_ID) fireEvent.change(ownerNameInput, { target: { value: NEW_OWNER_NAME } }) fireEvent.click(saveOwnerChangesBtn) await sleep(200) // check if the name updated - const ownerRow = SafeDom.getByTestId(OWNERS_ROW_TESTID) + const ownerRow = SafeDom.getByTestId(OWNERS_ROW_TEST_ID) expect(ownerRow).toHaveTextContent(NEW_OWNER_NAME) }) @@ -84,17 +84,17 @@ describe('DOM > Feature > Settings - Manage owners', () => { await sleep(1300) // Travel to settings - const settingsBtn = SafeDom.getByTestId(SETTINGS_TAB_BTN_TESTID) + const settingsBtn = SafeDom.getByTestId(SETTINGS_TAB_BTN_TEST_ID) fireEvent.click(settingsBtn) await sleep(200) // click on owners settings - const ownersSettingsBtn = SafeDom.getByTestId(OWNERS_SETTINGS_TAB_TESTID) + const ownersSettingsBtn = SafeDom.getByTestId(OWNERS_SETTINGS_TAB_TEST_ID) fireEvent.click(ownersSettingsBtn) await sleep(200) // check if there are 2 owners - let ownerRows = SafeDom.getAllByTestId(OWNERS_ROW_TESTID) + let ownerRows = SafeDom.getAllByTestId(OWNERS_ROW_TEST_ID) expect(ownerRows.length).toBe(2) expect(ownerRows[0]).toHaveTextContent('Adol 1 Eth Account') expect(ownerRows[0]).toHaveTextContent('0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1') @@ -102,22 +102,22 @@ describe('DOM > Feature > Settings - Manage owners', () => { expect(ownerRows[1]).toHaveTextContent('0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0') // click remove owner btn which opens the modal - const removeOwnerBtn = SafeDom.getAllByTestId(REMOVE_OWNER_BTN_TESTID)[1] + const removeOwnerBtn = SafeDom.getAllByTestId(REMOVE_OWNER_BTN_TEST_ID)[1] fireEvent.click(removeOwnerBtn) // modal navigation - const nextBtnStep1 = SafeDom.getByTestId(REMOVE_OWNER_MODAL_NEXT_BTN_TESTID) + const nextBtnStep1 = SafeDom.getByTestId(REMOVE_OWNER_MODAL_NEXT_BTN_TEST_ID) fireEvent.click(nextBtnStep1) - const nextBtnStep2 = SafeDom.getByTestId(REMOVE_OWNER_THRESHOLD_NEXT_BTN_TESTID) + const nextBtnStep2 = SafeDom.getByTestId(REMOVE_OWNER_THRESHOLD_NEXT_BTN_TEST_ID) fireEvent.click(nextBtnStep2) - const nextBtnStep3 = SafeDom.getByTestId(REMOVE_OWNER_REVIEW_BTN_TESTID) + const nextBtnStep3 = SafeDom.getByTestId(REMOVE_OWNER_REVIEW_BTN_TEST_ID) fireEvent.click(nextBtnStep3) await sleep(1300) // check if owner was removed - ownerRows = SafeDom.getAllByTestId(OWNERS_ROW_TESTID) + ownerRows = SafeDom.getAllByTestId(OWNERS_ROW_TEST_ID) expect(ownerRows.length).toBe(1) expect(ownerRows[0]).toHaveTextContent('Adol 1 Eth Account') expect(ownerRows[0]).toHaveTextContent('0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1') @@ -131,41 +131,41 @@ describe('DOM > Feature > Settings - Manage owners', () => { await sleep(1300) // Travel to settings - const settingsBtn = SafeDom.getByTestId(SETTINGS_TAB_BTN_TESTID) + const settingsBtn = SafeDom.getByTestId(SETTINGS_TAB_BTN_TEST_ID) fireEvent.click(settingsBtn) await sleep(200) // click on owners settings - const ownersSettingsBtn = SafeDom.getByTestId(OWNERS_SETTINGS_TAB_TESTID) + const ownersSettingsBtn = SafeDom.getByTestId(OWNERS_SETTINGS_TAB_TEST_ID) fireEvent.click(ownersSettingsBtn) await sleep(200) // check if there is 1 owner - let ownerRows = SafeDom.getAllByTestId(OWNERS_ROW_TESTID) + let ownerRows = SafeDom.getAllByTestId(OWNERS_ROW_TEST_ID) expect(ownerRows.length).toBe(1) expect(ownerRows[0]).toHaveTextContent('Adol 1 Eth Account') expect(ownerRows[0]).toHaveTextContent('0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1') // click add owner btn - fireEvent.click(SafeDom.getByTestId(ADD_OWNER_BTN_TESTID)) + fireEvent.click(SafeDom.getByTestId(ADD_OWNER_BTN_TEST_ID)) await sleep(200) // fill and travel add owner modal - const ownerNameInput = SafeDom.getByTestId(ADD_OWNER_NAME_INPUT_TESTID) - const ownerAddressInput = SafeDom.getByTestId(ADD_OWNER_ADDRESS_INPUT_TESTID) - const nextBtn = SafeDom.getByTestId(ADD_OWNER_NEXT_BTN_TESTID) + const ownerNameInput = SafeDom.getByTestId(ADD_OWNER_NAME_INPUT_TEST_ID) + const ownerAddressInput = SafeDom.getByTestId(ADD_OWNER_ADDRESS_INPUT_TEST_ID) + const nextBtn = SafeDom.getByTestId(ADD_OWNER_NEXT_BTN_TEST_ID) fireEvent.change(ownerNameInput, { target: { value: NEW_OWNER_NAME } }) fireEvent.change(ownerAddressInput, { target: { value: NEW_OWNER_ADDRESS } }) fireEvent.click(nextBtn) await sleep(200) - fireEvent.click(SafeDom.getByTestId(ADD_OWNER_THRESHOLD_NEXT_BTN_TESTID)) + fireEvent.click(SafeDom.getByTestId(ADD_OWNER_THRESHOLD_NEXT_BTN_TEST_ID)) await sleep(200) - fireEvent.click(SafeDom.getByTestId(ADD_OWNER_SUBMIT_BTN_TESTID)) + fireEvent.click(SafeDom.getByTestId(ADD_OWNER_SUBMIT_BTN_TEST_ID)) await sleep(1500) // check if owner was added - ownerRows = SafeDom.getAllByTestId(OWNERS_ROW_TESTID) + ownerRows = SafeDom.getAllByTestId(OWNERS_ROW_TEST_ID) expect(ownerRows.length).toBe(2) expect(ownerRows[0]).toHaveTextContent('Adol 1 Eth Account') expect(ownerRows[0]).toHaveTextContent('0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1') @@ -183,17 +183,17 @@ describe('DOM > Feature > Settings - Manage owners', () => { await sleep(1300) // Travel to settings - const settingsBtn = SafeDom.getByTestId(SETTINGS_TAB_BTN_TESTID) + const settingsBtn = SafeDom.getByTestId(SETTINGS_TAB_BTN_TEST_ID) fireEvent.click(settingsBtn) await sleep(200) // click on owners settings - const ownersSettingsBtn = SafeDom.getByTestId(OWNERS_SETTINGS_TAB_TESTID) + const ownersSettingsBtn = SafeDom.getByTestId(OWNERS_SETTINGS_TAB_TEST_ID) fireEvent.click(ownersSettingsBtn) await sleep(200) // check if there are 2 owners - let ownerRows = SafeDom.getAllByTestId(OWNERS_ROW_TESTID) + let ownerRows = SafeDom.getAllByTestId(OWNERS_ROW_TEST_ID) expect(ownerRows.length).toBe(2) expect(ownerRows[0]).toHaveTextContent('Adol 1 Eth Account') expect(ownerRows[0]).toHaveTextContent('0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1') @@ -201,24 +201,24 @@ describe('DOM > Feature > Settings - Manage owners', () => { expect(ownerRows[1]).toHaveTextContent('0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0') // click replace owner btn which opens the modal - const replaceOwnerBtn = SafeDom.getAllByTestId(REPLACE_OWNER_BTN_TESTID)[1] + const replaceOwnerBtn = SafeDom.getAllByTestId(REPLACE_OWNER_BTN_TEST_ID)[1] fireEvent.click(replaceOwnerBtn) // fill and travel add owner modal - const ownerNameInput = SafeDom.getByTestId(REPLACE_OWNER_NAME_INPUT_TESTID) - const ownerAddressInput = SafeDom.getByTestId(REPLACE_OWNER_ADDRESS_INPUT_TESTID) - const nextBtn = SafeDom.getByTestId(REPLACE_OWNER_NEXT_BTN_TESTID) + const ownerNameInput = SafeDom.getByTestId(REPLACE_OWNER_NAME_INPUT_TEST_ID) + const ownerAddressInput = SafeDom.getByTestId(REPLACE_OWNER_ADDRESS_INPUT_TEST_ID) + const nextBtn = SafeDom.getByTestId(REPLACE_OWNER_NEXT_BTN_TEST_ID) fireEvent.change(ownerNameInput, { target: { value: NEW_OWNER_NAME } }) fireEvent.change(ownerAddressInput, { target: { value: NEW_OWNER_ADDRESS } }) fireEvent.click(nextBtn) await sleep(200) - const replaceSubmitBtn = SafeDom.getByTestId(REPLACE_OWNER_SUBMIT_BTN_TESTID) + const replaceSubmitBtn = SafeDom.getByTestId(REPLACE_OWNER_SUBMIT_BTN_TEST_ID) fireEvent.click(replaceSubmitBtn) await sleep(1000) // check if the owner was replaced - ownerRows = SafeDom.getAllByTestId(OWNERS_ROW_TESTID) + ownerRows = SafeDom.getAllByTestId(OWNERS_ROW_TEST_ID) expect(ownerRows.length).toBe(2) expect(ownerRows[0]).toHaveTextContent('Adol 1 Eth Account') expect(ownerRows[0]).toHaveTextContent('0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1')