aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/app/transaction-status/tests/transaction-status.component.test.js
blob: ec1d580bddea60c0e8967b8df990c2fb3e15faea (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
import React from 'react'
import assert from 'assert'
import { mount } from 'enzyme'
import TransactionStatus from '../transaction-status.component'
import Tooltip from '../../../ui/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)
    assert.equal(wrapper.text(), 'APPROVED')
    assert.equal(wrapper.find(Tooltip).props().title, 'test-title')
  })

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

    assert.ok(wrapper)
    assert.equal(wrapper.text(), 'PENDING')
  })
})