mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
Update Add Host Modal Styles & Tests (#1068)
This commit is contained in:
parent
378331ab58
commit
3e3588706b
@ -18,7 +18,10 @@ class AddHostModal extends Component {
|
||||
constructor (props) {
|
||||
super(props);
|
||||
|
||||
this.state = { revealSecret: false };
|
||||
this.state = {
|
||||
revealSecret: false,
|
||||
secretText: '1234567890',
|
||||
};
|
||||
}
|
||||
|
||||
onCopySecret = (elementClass) => {
|
||||
@ -95,7 +98,7 @@ class AddHostModal extends Component {
|
||||
inputWrapperClass={`${baseClass}__secret-input`}
|
||||
name="osqueryd-secret"
|
||||
type={revealSecret ? 'text' : 'password'}
|
||||
value="1234567890"
|
||||
value={this.state.secretText}
|
||||
/>
|
||||
<Button variant="unstyled" className={`${baseClass}__secret-copy-icon`} onClick={onCopySecret(`.${baseClass}__secret-input`)}>
|
||||
<Icon name="clipboard" />
|
||||
|
@ -120,6 +120,10 @@
|
||||
right: 10px;
|
||||
font-size: 18px;
|
||||
color: $link;
|
||||
|
||||
&:active {
|
||||
top: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
&__secret-input {
|
||||
|
@ -93,14 +93,6 @@ export class ManageHostsPage extends Component {
|
||||
return false;
|
||||
}
|
||||
|
||||
onAddHostSubmit = () => {
|
||||
const { toggleAddHostModal } = this;
|
||||
|
||||
toggleAddHostModal();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
onAddHostClick = (evt) => {
|
||||
evt.preventDefault();
|
||||
|
||||
|
@ -246,4 +246,22 @@ describe('ManageHostsPage - component', () => {
|
||||
expect(hostActions.destroy).toHaveBeenCalledWith(offlineHost);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Add Host', () => {
|
||||
it('Open the Add Host modal from sidebar', () => {
|
||||
const page = mount(<ManageHostsPage {...props} hosts={[]} selectedLabel={allHostsLabel} />);
|
||||
const addNewHost = page.find('.host-side-panel__add-hosts');
|
||||
addNewHost.simulate('click');
|
||||
|
||||
expect(page.find('AddHostModal').length).toEqual(1);
|
||||
});
|
||||
|
||||
it('Open the Add Host modal from Lonely Host', () => {
|
||||
const page = mount(<ManageHostsPage {...props} hosts={[]} selectedLabel={allHostsLabel} />);
|
||||
const addNewHost = page.find('LonelyHost').find('Button');
|
||||
addNewHost.simulate('click');
|
||||
|
||||
expect(page.find('AddHostModal').length).toEqual(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user