|
|
|
@ -42,7 +42,8 @@ describe('SendGasRow Component', function () { |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
it('should render a SendRowWrapper component', function () { |
|
|
|
|
assert.equal(wrapper.find(SendRowWrapper).length, 1) |
|
|
|
|
assert.equal(wrapper.name(), 'Fragment') |
|
|
|
|
assert.equal(wrapper.at(0).find(SendRowWrapper).length, 1) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
it('should pass the correct props to SendRowWrapper', function () { |
|
|
|
@ -50,7 +51,7 @@ describe('SendGasRow Component', function () { |
|
|
|
|
label, |
|
|
|
|
showError, |
|
|
|
|
errorType, |
|
|
|
|
} = wrapper.find(SendRowWrapper).props() |
|
|
|
|
} = wrapper.find(SendRowWrapper).first().props() |
|
|
|
|
|
|
|
|
|
assert.equal(label, 'transactionFee_t:') |
|
|
|
|
assert.equal(showError, true) |
|
|
|
@ -58,7 +59,7 @@ describe('SendGasRow Component', function () { |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
it('should render a GasFeeDisplay as a child of the SendRowWrapper', function () { |
|
|
|
|
assert(wrapper.find(SendRowWrapper).childAt(0).is(GasFeeDisplay)) |
|
|
|
|
assert(wrapper.find(SendRowWrapper).first().childAt(0).is(GasFeeDisplay)) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
it('should render the GasFeeDisplay', function () { |
|
|
|
@ -66,7 +67,7 @@ describe('SendGasRow Component', function () { |
|
|
|
|
gasLoadingError, |
|
|
|
|
gasTotal, |
|
|
|
|
onReset, |
|
|
|
|
} = wrapper.find(SendRowWrapper).childAt(0).props() |
|
|
|
|
} = wrapper.find(SendRowWrapper).first().childAt(0).props() |
|
|
|
|
assert.equal(gasLoadingError, false) |
|
|
|
|
assert.equal(gasTotal, 'mockGasTotal') |
|
|
|
|
assert.equal(propsMethodSpies.resetGasButtons.callCount, 0) |
|
|
|
@ -76,8 +77,8 @@ describe('SendGasRow Component', function () { |
|
|
|
|
|
|
|
|
|
it('should render the GasPriceButtonGroup if gasButtonGroupShown is true', function () { |
|
|
|
|
wrapper.setProps({ gasButtonGroupShown: true }) |
|
|
|
|
const rendered = wrapper.find(SendRowWrapper).childAt(0) |
|
|
|
|
assert.equal(rendered.children().length, 2) |
|
|
|
|
const rendered = wrapper.find(SendRowWrapper).first().childAt(0) |
|
|
|
|
assert.equal(wrapper.children().length, 2) |
|
|
|
|
|
|
|
|
|
const gasPriceButtonGroup = rendered.childAt(0) |
|
|
|
|
assert(gasPriceButtonGroup.is(GasPriceButtonGroup)) |
|
|
|
@ -89,10 +90,10 @@ describe('SendGasRow Component', function () { |
|
|
|
|
|
|
|
|
|
it('should render an advanced options button if gasButtonGroupShown is true', function () { |
|
|
|
|
wrapper.setProps({ gasButtonGroupShown: true }) |
|
|
|
|
const rendered = wrapper.find(SendRowWrapper).childAt(0) |
|
|
|
|
assert.equal(rendered.children().length, 2) |
|
|
|
|
const rendered = wrapper.find(SendRowWrapper).last() |
|
|
|
|
assert.equal(wrapper.children().length, 2) |
|
|
|
|
|
|
|
|
|
const advancedOptionsButton = rendered.childAt(1) |
|
|
|
|
const advancedOptionsButton = rendered.childAt(0) |
|
|
|
|
assert.equal(advancedOptionsButton.text(), 'advancedOptions_t') |
|
|
|
|
|
|
|
|
|
assert.equal(propsMethodSpies.showCustomizeGasModal.callCount, 0) |
|
|
|
|