Skip to content
Snippets Groups Projects
Commit 7d1372f3 authored by Alexandros Georgantas's avatar Alexandros Georgantas
Browse files

Clean ups and new snapshots

parent 768fbc0e
No related branches found
No related tags found
No related merge requests found
import React from 'react' import React from 'react'
import { shallow } from 'enzyme'
import renderer from 'react-test-renderer' import renderer from 'react-test-renderer'
import Menu from '../src/atoms/Menu' import Menu from '../src/atoms/Menu'
...@@ -9,16 +8,9 @@ const props = { ...@@ -9,16 +8,9 @@ const props = {
value: 'foo', value: 'foo',
} }
const wrapper = shallow(<Menu {...props} />)
describe('Menu', () => { describe('Menu', () => {
test('Snapshot', () => { test('is rendered correctly', () => {
const tree = renderer.create(<Menu {...props} />).toJSON() const tree = renderer.create(<Menu {...props} />).toJSON()
expect(tree).toMatchSnapshot() expect(tree).toMatchSnapshot()
}) })
test('Renders a Menu', () => {
expect(wrapper.is('div')).toBeTruthy()
expect(wrapper).toHaveLength(1)
})
}) })
...@@ -15,7 +15,7 @@ const props = { ...@@ -15,7 +15,7 @@ const props = {
const wrapper = shallow(<Radio {...props} />) const wrapper = shallow(<Radio {...props} />)
describe('Radio', () => { describe('Radio', () => {
test('Snapshot', () => { test('is rendered correctly', () => {
const tree = renderer.create(<Radio {...props} />).toJSON() const tree = renderer.create(<Radio {...props} />).toJSON()
expect(tree).toMatchSnapshot() expect(tree).toMatchSnapshot()
}) })
......
...@@ -30,14 +30,12 @@ const wrapper = shallow(<RadioGroup {...props} />) ...@@ -30,14 +30,12 @@ const wrapper = shallow(<RadioGroup {...props} />)
const radios = wrapper.find(Radio) const radios = wrapper.find(Radio)
describe('Radio Group', () => { describe('Radio Group', () => {
test('Snapshot', () => { test('is rendered correctly', () => {
const tree = renderer.create(<RadioGroup {...props} />).toJSON() const tree = renderer.create(<RadioGroup {...props} />).toJSON()
expect(tree).toMatchSnapshot() expect(tree).toMatchSnapshot()
}) })
test('Renders a number of radio buttons', () => { test('Renders a number of radio buttons', () => {
expect(wrapper.is('div')).toBeTruthy()
const len = props.options.length const len = props.options.length
expect(wrapper.children()).toHaveLength(len) expect(wrapper.children()).toHaveLength(len)
......
...@@ -14,7 +14,7 @@ const wrapper = shallow(<YesOrNo {...props} />) ...@@ -14,7 +14,7 @@ const wrapper = shallow(<YesOrNo {...props} />)
const radio = wrapper.find(RadioGroup) const radio = wrapper.find(RadioGroup)
describe('Yes or No', () => { describe('Yes or No', () => {
test('Snapshot', () => { test('is rendered correclty', () => {
const tree = renderer.create(<YesOrNo {...props} />).toJSON() const tree = renderer.create(<YesOrNo {...props} />).toJSON()
expect(tree).toMatchSnapshot() expect(tree).toMatchSnapshot()
}) })
......
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Menu Snapshot 1`] = ` exports[`Menu is rendered correctly 1`] = `
<div <div
className="root" className="root"
> >
......
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Radio Snapshot 1`] = ` exports[`Radio is rendered correctly 1`] = `
<label <label
className="root" className="root"
style={ style={
......
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Radio Group Snapshot 1`] = ` exports[`Radio Group is rendered correctly 1`] = `
<div> <div>
<label <label
className="root" className="root"
......
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Yes or No Snapshot 1`] = ` exports[`Yes or No is rendered correclty 1`] = `
<div> <div>
<label <label
className="root inline" className="root inline"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment