Skip to content

Commit

Permalink
Add tests for [Property] label and [Property] argument
Browse files Browse the repository at this point in the history
  • Loading branch information
astralarya committed Aug 9, 2016
1 parent feb7d7c commit 80030bf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,28 @@ describe('<ConsolePrompt />', function() {
expect(wrapper.find('.react-console-cursor').text()).equals('r');
});
});
describe('[Property] label: ', function () {
it('`.react-console-prompt-label` has text \'foo\' when label=\'foo\'', function() {
var wrapper = enzyme.shallow(<ConsolePrompt label='foo'/>);
expect(wrapper.find('.react-console-prompt-label').text()).equals('foo');
});
});
describe('[Property] argument: ', function () {
it('`.react-console-prompt-argument` has text \'foo\' when argument=\'foo\'', function() {
var wrapper = enzyme.shallow(<ConsolePrompt argument='foo'/>);
expect(wrapper.find('.react-console-prompt-argument').text()).equals('foo');
});
it('`.react-console-prompt-label` has text \'\' when label=\'foo\' and `.react-console-prompt-argument` has text \'bar\' when argument=\'bar\'', function() {
var wrapper = enzyme.shallow(<ConsolePrompt label='foo' argument='bar'/>);
expect(wrapper.find('.react-console-prompt-label').text()).equals('');
expect(wrapper.find('.react-console-prompt-argument').text()).equals('bar');
});
it('`.react-console-prompt-label` has text \'foo\\n\' when label=\'foo\\nbar\' and `.react-console-prompt-argument` has text \'baz\' when argument=\'baz\'', function() {
var wrapper = enzyme.mount(<ConsolePrompt label='foo\nbar' argument='baz'/>);
expect(wrapper.find('.react-console-prompt-label').text()).equals('foo\n');
expect(wrapper.find('.react-console-prompt-argument').text()).equals('baz');
});
});
describe('[Style] idle: ', function () {
it('Is not idle right after mount', function() {
var wrapper = enzyme.shallow(<ConsolePrompt point={0}/>);
Expand Down

0 comments on commit 80030bf

Please sign in to comment.