Skip to content

Commit

Permalink
add appendIconStyles tests
Browse files Browse the repository at this point in the history
  • Loading branch information
estevanmaito committed May 17, 2019
1 parent 34c7f8a commit 436f9f5
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/__tests__/helpers/__snapshots__/appendIconStyles.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`appendIconStyle should create a style tag 1`] = `
<body>
<style
id="sharect-style"
>
.sharect svg{fill:#F34;}
</style>
</body>
`;

exports[`appendMobileIconStyle should update the style for mobile 1`] = `
<body>
<style
id="sharect-style"
>
.sharect svg{fill:#F34;width:5px;height:5px;}
</style>
</body>
`;
25 changes: 25 additions & 0 deletions src/__tests__/helpers/appendIconStyles.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {
appendIconStyle,
appendMobileIconStyle
} from '../../helpers/appendIconStyles'

const iconColor = '#F34'
const mobileIconSize = 5

describe('appendIconStyle', () => {
it('should create a style tag', () => {
appendIconStyle({ iconColor })

expect(document.body).toMatchSnapshot()
})
})

describe('appendMobileIconStyle', () => {
it('should update the style for mobile', () => {
appendMobileIconStyle(iconColor, mobileIconSize)

expect(document.body).toMatchSnapshot()
})

})

0 comments on commit 436f9f5

Please sign in to comment.