Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
081728a
commit 02140f0
Showing
4 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,5 +46,8 @@ module.exports = { | |
"error", | ||
{ "ignoreRestSiblings": true } | ||
] | ||
}, | ||
"globals": { | ||
"process": true | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`StickerToolbar should not render when platform is mac 1`] = ` | ||
<div> | ||
<StickerDescription /> | ||
</div> | ||
`; | ||
|
||
exports[`StickerToolbar should render correct when platform is windows 1`] = ` | ||
<div> | ||
<StickerToolBar /> | ||
<StickerDescription /> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// @flow | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { Sticker } from '../../../src/sticker/html'; | ||
|
||
describe('StickerToolbar', () => { | ||
let originalPlatform; | ||
|
||
beforeAll(() => { | ||
originalPlatform = process.platform; | ||
}); | ||
|
||
afterAll(() => { | ||
Object.defineProperty(process, 'platform', { | ||
value: originalPlatform | ||
}); | ||
}); | ||
|
||
it('should render correct when platform is windows', () => { | ||
Object.defineProperty(process, 'platform', { | ||
value: 'win32' | ||
}); | ||
expect(shallow(<Sticker/>)).toMatchSnapshot(); | ||
}); | ||
|
||
it('should not render when platform is mac', () => { | ||
Object.defineProperty(process, 'platform', { | ||
value: 'darwin' | ||
}); | ||
expect(shallow(<Sticker/>)).toMatchSnapshot(); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters