-
Notifications
You must be signed in to change notification settings - Fork 834
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 added in more tests
- Loading branch information
Showing
7 changed files
with
92 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,12 @@ | ||
import test from 'ava'; | ||
import ffmpeg from '@ffmpeg-installer/ffmpeg'; | ||
import execa from 'execa'; | ||
|
||
test('it should be able to find ffmpeg', t => { | ||
t.deepEqual(ffmpeg, ffmpeg); | ||
}); | ||
|
||
test('it should be able to find execa', t => { | ||
t.deepEqual(execa, execa); | ||
}); | ||
|
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 supportedVideoExtensions from '../main/common/constants'; | ||
|
||
test('it should support mp4 mov and m4v', t => { | ||
t.deepEqual(supportedVideoExtensions, {supportedVideoExtensions: ['mp4', 'mov', 'm4v']}); | ||
}); | ||
|
||
test('file extensions should equal .mp4 .mov and .m4v', t => { | ||
const supportedVideoExtensions = ['mp4', 'mov', 'm4v']; | ||
const fileExtensions = supportedVideoExtensions.map(ext => `.${ext}`); | ||
t.deepEqual(fileExtensions, ['.mp4', '.mov', '.m4v']); | ||
}); |
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')); | ||
}); |