Guest User

Untitled

a guest
Dec 11th, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. // lib/blocks/Button/__tests__/index.js
  2.  
  3. import React from 'react';
  4. import Button from '../index';
  5. import 'jest-styled-components';
  6.  
  7. import { renderWithTheme } from '__tests__/helpers';
  8.  
  9. describe('Button Block', () => {
  10. it('renders correctly', () => {
  11. const tree = renderWithTheme(
  12. <Button>
  13. <Button.Text>Login</Button.Text>
  14. <Button.Icon name="home" />
  15. </Button>
  16. ).toJSON();
  17. expect(tree).toMatchSnapshot();
  18. });
  19.  
  20. it('adds the primary modifier', () => {
  21. const tree = renderWithTheme(
  22. <Button modifiers={['primary']}>
  23. <Button.Text>Login</Button.Text>
  24. <Button.Icon name="home" />
  25. </Button>
  26. ).toJSON();
  27. expect(tree).toMatchSnapshot();
  28. });
  29.  
  30. it('adds the secondary modifier', () => {
  31. const tree = renderWithTheme(
  32. <Button modifiers={['secondary']}>
  33. <Button.Text>Login</Button.Text>
  34. <Button.Icon name="home" />
  35. </Button>
  36. ).toJSON();
  37. expect(tree).toMatchSnapshot();
  38. });
  39.  
  40. it('adds the disabled modifier', () => {
  41. const tree = renderWithTheme(
  42. <Button modifiers={['disabled']}>
  43. <Button.Text>Login</Button.Text>
  44. <Button.Icon name="home" />
  45. </Button>
  46. ).toJSON();
  47. expect(tree).toMatchSnapshot();
  48. });
  49. });
Add Comment
Please, Sign In to add comment