WA-235 Fix tests - Adapting buttons' index based on the new layout

This commit is contained in:
apanizo 2018-06-06 11:26:45 +02:00
parent 31e5833b8e
commit 058c6e04fd
3 changed files with 6 additions and 6 deletions

View File

@ -45,7 +45,7 @@ describe('React DOM TESTS > Withdrawn funds from safe', () => {
// $FlowFixMe
const buttons = TestUtils.scryRenderedComponentsWithType(Safe, Button)
const addTxButton = buttons[1]
const addTxButton = buttons[2]
expect(addTxButton.props.children).toEqual(ADD_MULTISIG_BUTTON_TEXT)
await sleep(1800) // Give time to enable Add button
TestUtils.Simulate.click(TestUtils.scryRenderedDOMComponentsWithTag(addTxButton, 'button')[0])

View File

@ -46,7 +46,7 @@ describe('React DOM TESTS > Withdrawn funds from safe', () => {
// $FlowFixMe
const buttons = TestUtils.scryRenderedComponentsWithType(Safe, Button)
const withdrawnButton = buttons[0]
const withdrawnButton = buttons[1]
expect(withdrawnButton.props.children).toEqual(WITHDRAWN_BUTTON_TEXT)
TestUtils.Simulate.click(TestUtils.scryRenderedDOMComponentsWithTag(withdrawnButton, 'button')[0])
await sleep(4000)
@ -96,7 +96,7 @@ describe('React DOM TESTS > Withdrawn funds from safe', () => {
const Safe = TestUtils.findRenderedComponentWithType(SafeDom, SafeView)
// $FlowFixMe
const buttons = TestUtils.scryRenderedComponentsWithType(Safe, Button)
const addTxButton = buttons[1]
const addTxButton = buttons[2]
expect(addTxButton.props.children).toEqual(ADD_MULTISIG_BUTTON_TEXT)
expect(addTxButton.props.disabled).toBe(true)
@ -110,7 +110,7 @@ describe('React DOM TESTS > Withdrawn funds from safe', () => {
const Safe = TestUtils.findRenderedComponentWithType(SafeDom, SafeView)
// $FlowFixMe
const buttons = TestUtils.scryRenderedComponentsWithType(Safe, Button)
const addTxButton = buttons[0]
const addTxButton = buttons[1]
expect(addTxButton.props.children).toEqual(WITHDRAWN_BUTTON_TEXT)
expect(addTxButton.props.disabled).toBe(true)

View File

@ -43,7 +43,7 @@ export const addFundsTo = async (SafeDom, destination: string) => {
// $FlowFixMe
const buttons = TestUtils.scryRenderedComponentsWithType(Safe, Button)
const addTxButton = buttons[1]
const addTxButton = buttons[2]
expect(addTxButton.props.children).toEqual(ADD_MULTISIG_BUTTON_TEXT)
await sleep(1800) // Give time to enable Add button
TestUtils.Simulate.click(TestUtils.scryRenderedDOMComponentsWithTag(addTxButton, 'button')[0])
@ -54,7 +54,7 @@ export const listTxsOf = (SafeDom) => {
// $FlowFixMe
const buttons = TestUtils.scryRenderedComponentsWithType(Safe, Button)
const seeTx = buttons[2]
const seeTx = buttons[3]
expect(seeTx.props.children).toEqual(SEE_MULTISIG_BUTTON_TEXT)
TestUtils.Simulate.click(TestUtils.scryRenderedDOMComponentsWithTag(seeTx, 'button')[0])
}