-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specs #36
Conversation
modal.props.closeModal(); | ||
expect(isShown).toBeFalsy(); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline required at end of file but not found eol-last
}); | ||
|
||
it('modal is hidden', () => { | ||
let modal = TestUtils.findRenderedComponentWithType(result, Modal); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'modal' is never reassigned. Use 'const' instead prefer-const
expect(modal.props.isOpen).toBeTruthy(); | ||
}); | ||
|
||
it('modal is hidden', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 4 indent
}); | ||
|
||
it('modal is shown', () => { | ||
let modal = TestUtils.findRenderedComponentWithType(result, Modal); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'modal' is never reassigned. Use 'const' instead prefer-const
); | ||
}); | ||
|
||
it('modal is shown', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 4 indent
expect(element.childNodes.length).toBeGreaterThan(0); | ||
}); | ||
|
||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline required at end of file but not found eol-last
}); | ||
|
||
fit('render application', () => { | ||
let element = TestUtils.findRenderedDOMComponentWithTag(result, 'tbody'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'element' is never reassigned. Use 'const' instead prefer-const
expect(element).toBeDefined(); | ||
}); | ||
|
||
fit('render application', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'fit' is not defined no-undef
}); | ||
|
||
fit('render the application rows', () => { | ||
let element = TestUtils.findRenderedDOMComponentWithClass(result, 'o-contain o-contain--full'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'element' is never reassigned. Use 'const' instead prefer-const
); | ||
}); | ||
|
||
fit('render the application rows', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'fit' is not defined no-undef
applications: { | ||
Spiderman: { | ||
Power1: "Wall Crawling", | ||
Power2: "Spidey Sense" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use singlequote quotes
saveApplication: () => {}, | ||
applications: { | ||
Spiderman: { | ||
Power1: "Wall Crawling", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use singlequote quotes
const childDivs = element.childNodes; | ||
const inputTag = childDivs[0].firstChild.childNodes[1]; | ||
expect(inputTag.value).toContain('SPEC_DESCRIPTION'); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon semi
onChange : () => {}, | ||
closeModal : () => { action = true; }, | ||
save : () => { action = true; }, | ||
description : "SPEC_DESCRIPTION" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use singlequote quotes
props = { | ||
application: { | ||
id : 314159, | ||
name : "SPECNAME", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use singlequote quotes
it('button is clicked', () => { | ||
const button = TestUtils.findRenderedDOMComponentWithClass(result, 'i-settings'); | ||
TestUtils.Simulate.click(button); | ||
expect(button); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write a test for the button.
}); | ||
|
||
it('renders application link', () => { | ||
const link = TestUtils.findRenderedDOMComponentWithClass(result, 'test-link'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try not to modify the code with test specific changes.
props = { | ||
onChange : () => {}, | ||
closeModal : () => { action = true; }, | ||
save : () => { action = true; }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make each action different.
@@ -34,7 +34,7 @@ export default class ApplicationRow extends React.Component { | |||
const styles = ApplicationRow.getStyles(); | |||
return ( | |||
<tr> | |||
<td> | |||
<td className="test-link"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change the code for tests
expect(span.textContent).toContain('123'); | ||
}); | ||
|
||
fit('renders application link', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'fit' is not defined no-undef
|
||
fit('button is clicked', () => { | ||
const button = TestUtils.findRenderedDOMComponentWithClass(result, 'i-settings'); | ||
debugger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected 'debugger' statement no-debugger
|
||
}); | ||
|
||
fit('button is clicked', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'fit' is not defined no-undef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* spec updates to include shallow from enzym and snapshots * spec script update * test dependencies updates
Created specs for all .jsx in the applications folder