77 | : (
78 |
80 |
81 |
, { context })
15 |
16 | expect(toJSON(wrapper)).toMatchSnapshot()
17 | })
18 |
19 | test('works with diff', () => {
20 | const wrapper = shallow(
, { context })
21 |
22 | expect(toJSON(wrapper)).toMatchSnapshot()
23 | })
24 |
--------------------------------------------------------------------------------
/test/components/Playground.spec.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { shallow } from 'enzyme'
3 | import SnapguidistPlayground from '../../src/components/Playground'
4 |
5 | jest.mock(
6 | 'react-styleguidist/lib/rsg-components/Playground/Playground',
7 | () => {
8 | const Playground = () => null
9 | return Playground
10 | }
11 | )
12 |
13 | const props = {
14 | code: 'code',
15 | evalInContext: () => {},
16 | index: 1,
17 | name: 'name',
18 | }
19 |
20 | test('passes the props to Playground', () => {
21 | const wrapper = shallow(
36 |
40 |
79 |
83 |
122 |
126 |
165 |
203 |
207 |