-
Notifications
You must be signed in to change notification settings - Fork 811
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created unit tests for components under renderer
added in babel plugin for css in jsx
- Loading branch information
Showing
5 changed files
with
66 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-react", | ||
], | ||
"plugins": [ | ||
"@babel/plugin-proposal-class-properties", | ||
"@babel/plugin-proposal-object-rest-spread", | ||
"@babel/plugin-transform-runtime", | ||
"styled-jsx/babel" | ||
] | ||
} |
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
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 @@ | ||
require('browser-env')(); |
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 @@ | ||
import test from 'ava'; | ||
import React from 'react'; | ||
import {mount, configure} from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
import KeyboardNumberInput from '../renderer/components/keyboard-number-input'; | ||
|
||
configure({adapter: new Adapter()}); | ||
|
||
test('it should render input', t => { | ||
const wrapper = mount(<KeyboardNumberInput/>); | ||
wrapper.find('input[type="text"]').at(2); | ||
const input = wrapper.simulate('change', {target: {value: 72}}); | ||
t.is((input.length), 1); | ||
}); |
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,12 @@ | ||
import test from 'ava'; | ||
import React from 'react'; | ||
import {shallow, configure} from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
import WindowHeader from '../renderer/components/window-header'; | ||
|
||
configure({adapter: new Adapter()}); | ||
|
||
test('can mount component window header', t => { | ||
const wrapper = shallow(<WindowHeader/>); | ||
t.true(wrapper.hasClass('window-header')); | ||
}); |