Skip to content

Commit

Permalink
Merge pull request #1413 from sarahd93/add_more_tests_gsa8
Browse files Browse the repository at this point in the history
Add tests for severitylevelsgroup, radio and task trend
  • Loading branch information
swaterkamp committed May 20, 2019
2 parents 188ed32 + cab771d commit a1fff14
Show file tree
Hide file tree
Showing 7 changed files with 644 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [8.0.1] - (unreleased)

### Added
- Add tests for severitylevelsgroup, radio button and task trend [#1413](https://github.com/greenbone/gsa/pull/1413)
- Allow to show error details [#1403](https://github.com/greenbone/gsa/pull/1403)
- Add test for solution type group [#1402](https://github.com/greenbone/gsa/pull/1402)
- Add tests for loginpage and structure components [#1390](https://github.com/greenbone/gsa/pull/1390)
Expand Down
113 changes: 113 additions & 0 deletions gsa/src/web/components/form/__tests__/__snapshots__/radio.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,116 @@ exports[`Radio tests should render radio 1`] = `
</div>
</label>
`;

exports[`Radio tests should render radio with children 1`] = `
.c2 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-pack: start;
-webkit-justify-content: start;
-ms-flex-pack: start;
justify-content: start;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.c3 {
margin-left: -5px;
}
.c3 > * {
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
}
.c3 > * {
margin-left: 5px;
}
.c1 {
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
}
.c0 {
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
font-weight: normal;
cursor: pointer;
}
.c5 {
font-family: inherit;
font-size: inherit;
padding: 0;
margin: 0;
margin-left: 10px;
line-height: normal;
width: auto;
height: auto;
}
.c4 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-pack: start;
-webkit-justify-content: flex-start;
-ms-flex-pack: start;
justify-content: flex-start;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
<label
class="c0"
>
<div
class="c1 c2"
>
<div
class="c3 c2"
margin="5px"
>
<input
class="c4 c5"
data-testid="radio-input"
type="radio"
value=""
/>
<span>
child1
</span>
<span>
child2
</span>
</div>
</div>
</label>
`;
10 changes: 10 additions & 0 deletions gsa/src/web/components/form/__tests__/radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ describe('Radio tests', () => {
expect(element).toMatchSnapshot();
});

test('should render radio with children', () => {
const {element} = render(
<Radio>
<span>child1</span>
<span>child2</span>
</Radio>,
);
expect(element).toMatchSnapshot();
});

test('should call change handler', () => {
const onChange = jest.fn();

Expand Down
Loading

0 comments on commit a1fff14

Please sign in to comment.