aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/pages/send/send-footer/tests/send-footer-selectors.test.js
blob: 8de032f57fffa33d0651772877b17460af3c2bd0 (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
import assert from 'assert'
import proxyquire from 'proxyquire'

const {
  isSendFormInError,
} = proxyquire('../send-footer.selectors', {
  '../send.selectors': {
    getSendErrors: (mockState) => mockState.errors,
  },
})

describe('send-footer selectors', () => {

  describe('getTitleKey()', () => {
    it('should return true if any of the values of the object returned by getSendErrors are truthy', () => {
      assert.equal(isSendFormInError({ errors: { a: 'abc', b: false} }), true)
    })

    it('should return false if all of the values of the object returned by getSendErrors are falsy', () => {
      assert.equal(isSendFormInError({ errors: { a: false, b: null} }), false)
    })
  })

})