showing results for - "jest test navlink"
Francesco
20 Mar 2018
1import React from 'react';
2import { expect } from 'chai';
3import { shallow, mount, render } from 'enzyme';
4import { NavLink } from 'react-router-dom';
5
6describe("<NavLink  />", () => {
7    it("1.contains correct passed prop", () => {
8        const comp = (
9            <NavLink to="/home"  className={"test"}>
10                NaveLink Test
11            </NavLink>
12        );
13        const wrapper = shallow( comp );
14        expect(wrapper.instance().props.to).to.equal("/home");
15    });
16});