Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jest test navlink

import React from 'react';
import { expect } from 'chai';
import { shallow, mount, render } from 'enzyme';
import { NavLink } from 'react-router-dom';

describe("<NavLink  />", () => {
    it("1.contains correct passed prop", () => {
        const comp = (
            <NavLink to="/home"  className={"test"}>
                NaveLink Test
            </NavLink>
        );
        const wrapper = shallow( comp );
        expect(wrapper.instance().props.to).to.equal("/home");
    });
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: express grpc example 
Javascript :: string comparison javascript 
Javascript :: js element on mouse over 
Javascript :: search object array javascript 
Javascript :: concat 
Javascript :: javascript remove function from object 
Javascript :: express mysql sessions 
Javascript :: print in javascript 
Javascript :: autocannon 
Javascript :: Show and Hide Content jQuery 
Javascript :: js add zeros before number 
Javascript :: js promise api 
Javascript :: trash alternate outline icon not coming to right side react 
Javascript :: javascript function add two numbers 
Javascript :: fill array javascript 
Javascript :: useroutes how to use 
Javascript :: checked unchecked through js 
Javascript :: how to display words from an array in a box in javascript 
Javascript :: multi key cookie js 
Javascript :: The .querySelector() Method 
Javascript :: find second smallest number in array javascript using for loop 
Javascript :: Replace symbol if it is preceded and followed by a word character js 
Javascript :: add language switcher to react-admin 
Javascript :: pass ref to class component react 
Javascript :: .reduce javascript 
Javascript :: selialize jquery 
Javascript :: js min number in array 
Javascript :: node js error 
Javascript :: LocomotiveScroll npm 
Javascript :: mongoose cursor eachasync 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =