Last active
March 22, 2019 16:10
-
-
Save michelts/fee4822a6402a8a049f2d0b9b9e71066 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { shallow } from 'enzyme'; | |
import { useGlobal } from 'reactn'; | |
import Cards from './cards'; | |
jest.mock('reactn'); | |
it('should render a Card component for each global state card', () => { | |
const cards = ['Q', 'J', 'K', 'A', '2']; | |
useGlobal.mockReturnValueOnce([cards]); | |
const wrapper = shallow(<Cards />); | |
expect(wrapper).toMatchSnapshot(); | |
}); | |
it('should tell no card is selected if cards are empty', () => { | |
const cards = []; | |
useGlobal.mockReturnValueOnce([cards]); | |
const wrapper = shallow(<Cards />); | |
expect(wrapper).toMatchSnapshot(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment