aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/transaction-status/tests/transaction-status.component.test.js
blob: 9e3bffe4f982066d07ecf1fdd51707864fa06ccd (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 { mount } from 'enzyme'
import TransactionStatus from '../transaction-status.component'
import Tooltip from '../../tooltip-v2'

describe('TransactionStatus Component', () => {
  it('should render APPROVED properly', () => {
    const wrapper = mount(
      <TransactionStatus
        statusKey="approved"
        title="test-title"
      />,
      { context: { t: str => str.toUpperCase() } }
    )

    assert.ok(wrapper)
    const tooltipProps = wrapper.find(Tooltip).props()
    assert.equal(tooltipProps.children, 'APPROVED')
    assert.equal(tooltipProps.title, 'test-title')
  })

  it('should render SUBMITTED properly', () => {
    const wrapper = mount(
      <TransactionStatus
        statusKey="submitted"
      />,
      { context: { t: str => str.toUpperCase() } }
    )

    assert.ok(wrapper)
    const tooltipProps = wrapper.find(Tooltip).props()
    assert.equal(tooltipProps.children, 'PENDING')
  })
})