add title to transaction action component (#8050)

feature/default_network_editable
Vodopyanov Egor 5 years ago committed by GitHub
parent dcc7d29511
commit b63b848ed4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      ui/app/components/app/transaction-action/tests/transaction-action.component.test.js
  2. 6
      ui/app/components/app/transaction-action/transaction-action.component.js

@ -46,6 +46,7 @@ describe('TransactionAction Component', function () {
assert.equal(wrapper.find('.transaction-action').length, 1) assert.equal(wrapper.find('.transaction-action').length, 1)
wrapper.setState({ transactionAction: 'sentEther' }) wrapper.setState({ transactionAction: 'sentEther' })
assert.equal(wrapper.text(), 'sentEther') assert.equal(wrapper.text(), 'sentEther')
assert.equal(wrapper.find('.transaction-action').props().title.trim(), 'sentEther')
}) })
it('should render Approved', async function () { it('should render Approved', async function () {
@ -81,6 +82,7 @@ describe('TransactionAction Component', function () {
assert.ok(wrapper) assert.ok(wrapper)
assert.equal(wrapper.find('.transaction-action').length, 1) assert.equal(wrapper.find('.transaction-action').length, 1)
assert.equal(wrapper.find('.transaction-action').text().trim(), 'Approve') 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 () { it('should render contractInteraction', async function () {
@ -114,6 +116,7 @@ describe('TransactionAction Component', function () {
assert.ok(wrapper) assert.ok(wrapper)
assert.equal(wrapper.find('.transaction-action').length, 1) assert.equal(wrapper.find('.transaction-action').length, 1)
assert.equal(wrapper.find('.transaction-action').text().trim(), 'contractInteraction') assert.equal(wrapper.find('.transaction-action').text().trim(), 'contractInteraction')
assert.equal(wrapper.find('.transaction-action').props().title.trim(), 'contractInteraction')
}) })
}) })
}) })

@ -29,9 +29,11 @@ export default class TransactionAction extends PureComponent {
render () { render () {
const { className } = this.props const { className } = this.props
const action = this.getTransactionAction()
return ( return (
<div className={classnames('transaction-action', className)}> <div className={classnames('transaction-action', className)} title={action}>
{ this.getTransactionAction() } { action }
</div> </div>
) )
} }

Loading…
Cancel
Save