Browse Source

enhance(form-tests): Test that Pay Form display respects isOnchain / isLn props

renovate/lint-staged-8.x
Ben Woosley 7 years ago
parent
commit
2421673379
No known key found for this signature in database GPG Key ID: 6EE5F3785F78B345
  1. 22
      test/components/Form/Payform.spec.js

22
test/components/Form/Payform.spec.js

@ -38,4 +38,26 @@ describe('Form', () => {
expect(el.contains('on-chain')).toBe(false)
})
})
describe('should show lightning with a lightning input', () => {
const props = { ...defaultProps, isLn: true }
const el = shallow(<PayForm {...props} />)
it('should contain PayForm', () => {
expect(el.find('input#paymentRequest').props.value).toBe(undefined)
expect(el.contains('lightning network')).toBe(true)
expect(el.contains('on-chain')).toBe(false)
})
})
describe('should show on-chain with an on-chain input', () => {
const props = { ...defaultProps, isOnchain: true }
const el = shallow(<PayForm {...props} />)
it('should contain PayForm', () => {
expect(el.find('input#paymentRequest').props.value).toBe(undefined)
expect(el.contains('lightning network')).toBe(false)
expect(el.contains('on-chain')).toBe(true)
})
})
})

Loading…
Cancel
Save