You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

32 lines
910 B

import React from 'react'
import { shallow } from 'enzyme'
import { NavLink } from 'react-router-dom'
import Nav from 'components/Nav'
const defaultProps = {
ticker: {
currency: 'usd',
crypto: 'btc'
},
balance: {},
setCurrency: () => {},
currentTicker: {},
openPayForm: () => {},
openRequestForm: () => {}
}
describe('default elements', () => {
const props = { ...defaultProps }
const el = shallow(<Nav {...props} />)
it('should render nav links', () => {
expect(el.find(NavLink).at(0).props().to).toBe('/')
expect(el.find(NavLink).at(1).props().to).toBe('/wallet')
expect(el.find(NavLink).at(2).props().to).toBe('/channels')
expect(el.find(NavLink).at(3).props().to).toBe('/settings')
})
it('should render buttons', () => {
expect(el.find('.button').at(0).text()).toContain('Pay')
expect(el.find('.button').at(1).text()).toContain('Request')
})
})