aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/transaction-activity-log/tests/transaction-activity-log.component.test.js
blob: 8687dbbc72ac29c4195b1a86f2b9f7726bec5add (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React from 'react'
import assert from 'assert'
import { shallow } from 'enzyme'
import TransactionActivityLog from '../transaction-activity-log.component'
import Card from '../../card'

describe('TransactionActivityLog Component', () => {
  it('should render properly', () => {
    const transaction = {
      history: [],
      id: 1,
      status: 'confirmed',
      txParams: {
        from: '0x1',
        gas: '0x5208',
        gasPrice: '0x3b9aca00',
        nonce: '0xa4',
        to: '0x2',
        value: '0x2386f26fc10000',
      },
    }

    const wrapper = shallow(
      <TransactionActivityLog
        transaction={transaction}
        className="test-class"
      />,
      { context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } }
    )

    assert.ok(wrapper.hasClass('transaction-activity-log'))
    assert.ok(wrapper.hasClass('test-class'))
    assert.equal(wrapper.find(Card).length, 1)
  })
})