Skip to content

Commit

Permalink
Merge pull request #2891 from swaterkamp/radiusSecretKey
Browse files Browse the repository at this point in the history
Fix setting Radius secret key in dialog
  • Loading branch information
sarahd93 authored May 7, 2021
2 parents 004ed3e + db2c8a2 commit ecefb99
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unrelased]

### Added
- Added @testing-library/user-event as a dev-dependency [#2891](https://github.com/greenbone/gsa/pull/2891)

### Changed
- Use greenbone sensor as default scanner type when opening the dialog if available [#2867](https://github.com/greenbone/gsa/pull/2867)

### Fixed
- Fixed missing name for CVE results on result detailspage [#2892](https://github.com/greenbone/gsa/pull/2892)
- Fix setting result UUID in notes dialog [#2889](https://github.com/greenbone/gsa/pull/2889)
- Fixed setting secret key in RADIUS dialog [#2891](https://github.com/greenbone/gsa/pull/2891)
- Fixed setting result UUID in notes dialog [#2889](https://github.com/greenbone/gsa/pull/2889)

### Removed

Expand All @@ -23,7 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added
- Allow to set unix socket permissions for gsad [#2816](https://github.com/greenbone/gsa/pull/2816)
- Added CVSS date to NVT details [#2802](https://github.com/greenbone/gsa/pull/2802)
- Add option to allow to scan simultaneous IPs to targets
- Added option to allow to scan simultaneous IPs to targets
[#2779](https://github.com/greenbone/gsa/pull/2779),
[#2813](https://github.com/greenbone/gsa/pull/2813)
- Added CVSS origin to NVT details [#2588](https://github.com/greenbone/gsa/pull/2588)
Expand All @@ -48,7 +51,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).


### Fixed
- Fix dynamic severity checkbox not being checked upon clicking [#2882](https://github.com/greenbone/gsa/pull/2882)
- Fixed dynamic severity checkbox not being checked upon clicking [#2882](https://github.com/greenbone/gsa/pull/2882)
- Fixed result CVE parsing for result listpage and CVE reports [#2869](https://github.com/greenbone/gsa/pull/2869)
- Fixed setting comments of business process nodes [#2781](https://github.com/greenbone/gsa/pull/2781)
- Added the deprecatedBy field to CPEs [#2751](https://github.com/greenbone/gsa/pull/2751)
Expand Down
1 change: 1 addition & 0 deletions gsa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"@storybook/react": "^6.2.9",
"@testing-library/jest-dom": "^5.12.0",
"@testing-library/react": "^11.2.6",
"@testing-library/user-event": "^13.1.8",
"@types/jest": "^26.0.23",
"babel-plugin-i18next-extract": "^0.8.3",
"eslint-config-prettier": "^8.3.0",
Expand Down
12 changes: 6 additions & 6 deletions gsa/src/web/pages/radius/__tests__/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React from 'react';

import userEvent from '@testing-library/user-event';
import {render, fireEvent} from 'web/utils/testing';

import Dialog from '../dialog';
Expand Down Expand Up @@ -91,7 +91,7 @@ describe('RADIUS dialog component tests', () => {
<Dialog
enable={true}
radiushost="foo"
radiuskey="bar"
radiuskey="x"
onClose={handleClose}
onSave={handleSave}
/>,
Expand All @@ -101,18 +101,18 @@ describe('RADIUS dialog component tests', () => {
fireEvent.click(checkBox);

const radiusHostTextField = getByTestId('radiushost-textfield');
fireEvent.change(radiusHostTextField, {target: {value: 'lorem'}});
userEvent.type(radiusHostTextField, 'lorem');

const radiusKeyTextField = getByTestId('radiuskey-textfield');
fireEvent.change(radiusKeyTextField, {target: {value: 'ipsum'}});
userEvent.type(radiusKeyTextField, '{backspace}bar');

const saveButton = getByTestId('dialog-save-button');
fireEvent.click(saveButton);

expect(handleSave).toHaveBeenCalledWith({
radiushost: 'lorem',
radiushost: 'foolorem',
enable: false,
radiuskey: 'ipsum',
radiuskey: 'bar',
});
});
});
2 changes: 1 addition & 1 deletion gsa/src/web/pages/radius/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const RadiusDialog = ({
data-testid="radiuskey-textfield"
name="radiuskey"
size="50"
value={radiuskey}
value={values.radiuskey}
onChange={onValueChange}
/>
</FormGroup>
Expand Down

0 comments on commit ecefb99

Please sign in to comment.