Skip to content

Commit

Permalink
Merge pull request #1519 from hawkrives/greenkeeper/styled-components…
Browse files Browse the repository at this point in the history
…-2.0.1

Update styled-components to the latest version 🚀
  • Loading branch information
hawkrives authored Jun 8, 2017
2 parents d37f325 + f0d70ea commit 1ae3417
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 124 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Year can add a semester 1`] = `
<styled.div>
<styled.header>
<styled.h1>
Expand All @@ -18,22 +16,20 @@ exports[`Year can add a semester 1`] = `
Fall
</Styled(Button)>
<Styled(Button)
<Styled(Styled(Button))
onClick={[Function]}
title="Remove the year 2016—2017"
type="flat"
>
Remove Year
</Styled(Button)>
</Styled(Styled(Button))>
</span>
</styled.header>
<styled.div />
</styled.div>
`;

exports[`Year can add a semester 2`] = `
<styled.div>
<styled.header>
<styled.h1>
Expand All @@ -49,22 +45,20 @@ exports[`Year can add a semester 2`] = `
Fall
</Styled(Button)>
<Styled(Button)
<Styled(Styled(Button))
onClick={[Function]}
title="Remove the year 2016—2017"
type="flat"
>
Remove Year
</Styled(Button)>
</Styled(Styled(Button))>
</span>
</styled.header>
<styled.div />
</styled.div>
`;

exports[`Year can remove a semester 1`] = `
<styled.div>
<styled.header>
<styled.h1>
Expand All @@ -80,22 +74,20 @@ exports[`Year can remove a semester 1`] = `
Fall
</Styled(Button)>
<Styled(Button)
<Styled(Styled(Button))
onClick={[Function]}
title="Remove the year 2016—2017"
type="flat"
>
Remove Year
</Styled(Button)>
</Styled(Styled(Button))>
</span>
</styled.header>
<styled.div />
</styled.div>
`;

exports[`Year can remove a semester 2`] = `
<styled.div>
<styled.header>
<styled.h1>
Expand All @@ -111,36 +103,34 @@ exports[`Year can remove a semester 2`] = `
Fall
</Styled(Button)>
<Styled(Button)
<Styled(Styled(Button))
onClick={[Function]}
title="Remove the year 2016—2017"
type="flat"
>
Remove Year
</Styled(Button)>
</Styled(Styled(Button))>
</span>
</styled.header>
<styled.div />
</styled.div>
`;

exports[`Year renders shallowly 1`] = `
<div
className="jGXOTq"
className="sc-jhAzac jHxpTp"
>
<header
className="brAfmU"
className="sc-fBuWsC hJifQM"
>
<h1
className="jBbibS"
className="sc-fMiknA lvJZL"
>
2016—2017
</h1>
<span>
<button
className="button button--flat bDreTM"
className="button button--flat sc-dVhcbM fvKlhn"
disabled={undefined}
onClick={[Function]}
style={undefined}
Expand All @@ -152,7 +142,7 @@ exports[`Year renders shallowly 1`] = `
</button>
<button
className="button button--flat jIQrdF"
className="button button--flat sc-eqIVtm gjViaw sc-dVhcbM fvKlhn"
disabled={undefined}
onClick={[Function]}
style={undefined}
Expand All @@ -164,7 +154,7 @@ exports[`Year renders shallowly 1`] = `
</span>
</header>
<div
className="gwcmEI"
className="sc-fAjcbJ kuQnpu"
/>
</div>
`;
11 changes: 5 additions & 6 deletions modules/web/modules/course-table/__tests__/year.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Year from '../year'
import { Student } from '../../../../../modules/object-student/student'
import renderer from 'react-test-renderer'
import { shallow } from 'enzyme'
import 'jest-styled-components'

const mockStudent = () =>
Student({
Expand All @@ -28,7 +27,7 @@ test('Year renders shallowly', () => {
/>
)

expect(tree).toMatchStyledComponentsSnapshot()
expect(tree).toMatchSnapshot()
})

test('Year can add a semester', () => {
Expand All @@ -46,14 +45,14 @@ test('Year can add a semester', () => {
/>
)

expect(tree).toMatchStyledComponentsSnapshot()
expect(tree).toMatchSnapshot()

tree.find({ title: 'Add Semester' }).simulate('click')

expect(addSemester).toHaveBeenCalled()
expect(removeYear).not.toHaveBeenCalled()

expect(tree).toMatchStyledComponentsSnapshot()
expect(tree).toMatchSnapshot()
})

test('Year can remove a semester', () => {
Expand All @@ -71,12 +70,12 @@ test('Year can remove a semester', () => {
/>
)

expect(tree).toMatchStyledComponentsSnapshot()
expect(tree).toMatchSnapshot()

tree.find({ title: 'Remove the year 2016—2017' }).simulate('click')

expect(addSemester).not.toHaveBeenCalled()
expect(removeYear).toHaveBeenCalled()

expect(tree).toMatchStyledComponentsSnapshot()
expect(tree).toMatchSnapshot()
})
Loading

0 comments on commit 1ae3417

Please sign in to comment.