Update console-device-action-component

This commit is contained in:
Piotr Pekala 2019-07-23 04:31:00 -07:00
parent 16bf6ebffa
commit da7ecf3446
2 changed files with 4 additions and 5 deletions

View File

@ -103,10 +103,10 @@ describe('ConsoleDeviceActionComponent', () => {
});
});
it('should show message when command is not defined', async () => {
it('should set command when it is not defined', async () => {
mockedSettingsService.set('console_command', undefined);
await component.console();
expect(component.openConsole).not.toHaveBeenCalled();
expect(component.openConsole).toHaveBeenCalled();
});
it('should show message when there is no started nodes', async () => {

View File

@ -25,11 +25,10 @@ export class ConsoleDeviceActionComponent implements OnInit {
}
async console() {
const consoleCommand = this.settingsService.get<string>('console_command');
let consoleCommand = this.settingsService.get<string>('console_command');
if(consoleCommand === undefined) {
this.toasterService.error('Console command is not defined. Please change it in the Settings.');
return;
consoleCommand = `putty.exe -telnet \%h \%p -wt \"\%d\" -gns3 5 -skin 4`;
}
const startedNodes = this.nodes.filter(node => node.status === 'started');