From b63b848ed4a112ebfe66c1565d8410edcb772a28 Mon Sep 17 00:00:00 2001 From: Vodopyanov Egor Date: Fri, 14 Feb 2020 19:31:44 +0300 Subject: [PATCH] add title to transaction action component (#8050) --- .../tests/transaction-action.component.test.js | 3 +++ .../app/transaction-action/transaction-action.component.js | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/app/components/app/transaction-action/tests/transaction-action.component.test.js b/ui/app/components/app/transaction-action/tests/transaction-action.component.test.js index 2168fe1f7..2f99ca0cb 100644 --- a/ui/app/components/app/transaction-action/tests/transaction-action.component.test.js +++ b/ui/app/components/app/transaction-action/tests/transaction-action.component.test.js @@ -46,6 +46,7 @@ describe('TransactionAction Component', function () { assert.equal(wrapper.find('.transaction-action').length, 1) wrapper.setState({ transactionAction: 'sentEther' }) assert.equal(wrapper.text(), 'sentEther') + assert.equal(wrapper.find('.transaction-action').props().title.trim(), 'sentEther') }) it('should render Approved', async function () { @@ -81,6 +82,7 @@ describe('TransactionAction Component', function () { assert.ok(wrapper) assert.equal(wrapper.find('.transaction-action').length, 1) assert.equal(wrapper.find('.transaction-action').text().trim(), 'Approve') + assert.equal(wrapper.find('.transaction-action').props().title.trim(), 'Approve') }) it('should render contractInteraction', async function () { @@ -114,6 +116,7 @@ describe('TransactionAction Component', function () { assert.ok(wrapper) assert.equal(wrapper.find('.transaction-action').length, 1) assert.equal(wrapper.find('.transaction-action').text().trim(), 'contractInteraction') + assert.equal(wrapper.find('.transaction-action').props().title.trim(), 'contractInteraction') }) }) }) diff --git a/ui/app/components/app/transaction-action/transaction-action.component.js b/ui/app/components/app/transaction-action/transaction-action.component.js index 26012ff7f..e1617fcbc 100644 --- a/ui/app/components/app/transaction-action/transaction-action.component.js +++ b/ui/app/components/app/transaction-action/transaction-action.component.js @@ -29,9 +29,11 @@ export default class TransactionAction extends PureComponent { render () { const { className } = this.props + const action = this.getTransactionAction() + return ( -
- { this.getTransactionAction() } +
+ { action }
) }