@@ -10,7 +10,7 @@ import * as chai from 'chai';
1010import * as sinonChai from 'sinon-chai' ;
1111import * as sinon from 'sinon' ;
1212import { TestItem } from './testOSItem' ;
13- import { OdoImpl } from '../../src/odo' ;
13+ import { OdoImpl , Command } from '../../src/odo' ;
1414import { Component } from '../../src/openshift/component' ;
1515import { Progress } from '../../src/util/progress' ;
1616import { OpenShiftItem } from '../../src/openshift/openshiftItem' ;
@@ -727,4 +727,26 @@ suite('Openshift/Component', () => {
727727 expect ( termStub ) . calledOnceWith ( `odo push ${ componentItem . getName ( ) } --app ${ appItem . getName ( ) } --project ${ projectItem . getName ( ) } ` ) ;
728728 } ) ;
729729 } ) ;
730+
731+ suite ( 'watch' , ( ) => {
732+
733+ setup ( ( ) => {
734+ quickPickStub = sandbox . stub ( vscode . window , 'showQuickPick' ) ;
735+ quickPickStub . onFirstCall ( ) . resolves ( projectItem ) ;
736+ quickPickStub . onSecondCall ( ) . resolves ( appItem ) ;
737+ quickPickStub . onThirdCall ( ) . resolves ( componentItem ) ;
738+ } ) ;
739+
740+ test ( 'calls the correct odo command w/ context' , async ( ) => {
741+ await Component . watch ( componentItem ) ;
742+
743+ expect ( termStub ) . calledOnceWith ( Command . watchComponent ( projectItem . getName ( ) , appItem . getName ( ) , componentItem . getName ( ) ) ) ;
744+ } ) ;
745+
746+ test ( 'calls the correct odo command w/o context' , async ( ) => {
747+ await Component . watch ( null ) ;
748+
749+ expect ( termStub ) . calledOnceWith ( Command . watchComponent ( projectItem . getName ( ) , appItem . getName ( ) , componentItem . getName ( ) ) ) ;
750+ } ) ;
751+ } ) ;
730752} ) ;
0 commit comments