Rename test variables
This commit is contained in:
parent
abae5ab25a
commit
625255de2d
|
@ -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}
|
||||
/>
|
||||
</Block>
|
||||
</Block>
|
||||
|
@ -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
|
||||
</Button>
|
||||
|
|
|
@ -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}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
@ -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}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
@ -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
|
||||
</Button>
|
||||
|
|
|
@ -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
|
||||
</Button>
|
||||
|
|
|
@ -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
|
||||
</Button>
|
||||
|
|
|
@ -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}
|
||||
/>
|
||||
</Row>
|
||||
<Row>
|
||||
|
@ -105,7 +105,7 @@ const EditOwnerComponent = ({
|
|||
<Button className={classes.button} minWidth={140} onClick={onClose}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button type="submit" className={classes.button} variant="contained" minWidth={140} color="primary" testId={SAVE_OWNER_CHANGES_BTN_TESTID}>
|
||||
<Button type="submit" className={classes.button} variant="contained" minWidth={140} color="primary" testId={SAVE_OWNER_CHANGES_BTN_TEST_ID}>
|
||||
Save
|
||||
</Button>
|
||||
</Row>
|
||||
|
|
|
@ -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
|
||||
</Button>
|
||||
|
|
|
@ -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
|
||||
</Button>
|
||||
|
|
|
@ -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
|
||||
</Button>
|
||||
|
|
|
@ -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}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
@ -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}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
@ -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
|
||||
</Button>
|
||||
|
|
|
@ -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
|
||||
</Button>
|
||||
|
|
|
@ -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<Props, State> {
|
|||
noBorder
|
||||
>
|
||||
{(sortedData: Array<OwnerRow>) => sortedData.map((row: any, index: number) => (
|
||||
<TableRow tabIndex={-1} key={index} className={classes.hide} data-testid={OWNERS_ROW_TESTID}>
|
||||
<TableRow tabIndex={-1} key={index} className={classes.hide} data-testid={OWNERS_ROW_TEST_ID}>
|
||||
{autoColumns.map((column: Column) => (
|
||||
<TableCell key={column.id} style={cellWidth(column.width)} align={column.align} component="td">
|
||||
{column.id === OWNERS_TABLE_ADDRESS_ID ? (
|
||||
|
@ -162,14 +162,14 @@ class ManageOwners extends React.Component<Props, State> {
|
|||
className={classes.editOwnerIcon}
|
||||
src={RenameOwnerIcon}
|
||||
onClick={this.onShow('EditOwner', row)}
|
||||
testId={RENAME_OWNER_BTN_TESTID}
|
||||
testId={RENAME_OWNER_BTN_TEST_ID}
|
||||
/>
|
||||
<Img
|
||||
alt="Replace owner"
|
||||
className={classes.replaceOwnerIcon}
|
||||
src={ReplaceOwnerIcon}
|
||||
onClick={this.onShow('ReplaceOwner', row)}
|
||||
testId={REPLACE_OWNER_BTN_TESTID}
|
||||
testId={REPLACE_OWNER_BTN_TEST_ID}
|
||||
/>
|
||||
{ownerData.size > 1 && (
|
||||
<Img
|
||||
|
@ -177,7 +177,7 @@ class ManageOwners extends React.Component<Props, State> {
|
|||
className={classes.removeOwnerIcon}
|
||||
src={RemoveOwnerIcon}
|
||||
onClick={this.onShow('RemoveOwner', row)}
|
||||
testId={REMOVE_OWNER_BTN_TESTID}
|
||||
testId={REMOVE_OWNER_BTN_TEST_ID}
|
||||
/>
|
||||
)}
|
||||
</Row>
|
||||
|
@ -199,7 +199,7 @@ class ManageOwners extends React.Component<Props, State> {
|
|||
variant="contained"
|
||||
color="primary"
|
||||
onClick={this.onShow('AddOwner')}
|
||||
testId={ADD_OWNER_BTN_TESTID}
|
||||
testId={ADD_OWNER_BTN_TEST_ID}
|
||||
>
|
||||
Add new owner
|
||||
</Button>
|
||||
|
|
|
@ -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<Props, State> {
|
|||
<Row
|
||||
className={cn(classes.menuOption, menuOptionIndex === 2 && classes.active)}
|
||||
onClick={this.handleChange(2)}
|
||||
testId={OWNERS_SETTINGS_TAB_TESTID}
|
||||
testId={OWNERS_SETTINGS_TAB_TEST_ID}
|
||||
>
|
||||
Owners (
|
||||
{owners.size}
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue