51. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 12/8/2017 1:33:40 PM Central Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

51.1 Files compared

# Location File Last Modified
1 PC_CP4_CiF.zip\FPPS_Frontend\fpps-app\src\app\tools\station-maintenance\add-contact-info station-maintenance-add-contact-info.component.spec.ts Fri Dec 8 17:52:26 2017 UTC
2 PC_CP4_CiF.zip\FPPS_Frontend\fpps-app\src\app\tools\station-maintenance\add-contact-info station-maintenance-add-contact-info.component.spec.ts Fri Dec 8 18:37:05 2017 UTC

51.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 966
Changed 1 2
Inserted 0 0
Removed 0 0

51.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

51.4 Active regular expressions

No regular expressions were active.

51.5 Comparison detail

  1   import { a sync, Comp onentFixtu re, TestBe d } from ' @angular/c ore/testin g';
  2   import { D ebugElemen t } from ' @angular/c ore';
  3   import { B y } from ' @angular/p latform-br owser';
  4  
  5   import { F ormsModule  } from '@ angular/fo rms';
  6   import { R outerTesti ngModule }  from '@an gular/rout er/testing ';
  7   import { H ttpModule  } from '@a ngular/htt p';
  8  
  9   import { O bservable  } from 'rx js/Observa ble';
  10  
  11   import { M enuCompone nt } from  '../../../ shared/men u/menu.com ponent';
  12  
  13   import { S tationMain tenanceAdd ContactInf oComponent  } from '. /station-m aintenance -add-conta ct-info.co mponent';
  14  
  15   import { S tationMain tenanceAdd ContactInf oService }  from './s tation-mai ntenance-a dd-contact -info.serv ice';
  16   import { E ditStation Service }  from '../e dit-statio n/station- edit-maint enance.ser vice';
  17   import { W indowRefSe rvice } fr om '../../ ../window- ref.servic e';
  18  
  19   // Frankli n Perez (1 0/30/20917 ): Used te chnique de sribed in  the
  20   // https:/ /stackover flow.com/q uestions/4 3549861/un it-testing -and-mocki ng-a-servi ce-with-di
  21   // web pag e to Mock  a Service.
  22   class Mock StationMai ntenanceAd dContactIn foService  extends St ationMaint enanceAddC ontactInfo Service {
  23           co nstructor( ) {
  24                    supe r(null);
  25           }
  26  
  27           st ation = {
  28           "s tationId":  "999",
  29           "s hortName":  "GENHOSP" ,
  30           "n ame": "Gen eral Hospi tal",
  31           "t ype": "HOS P",
  32           "v isn": "9",
  33           "a llowRerout e": "true" ,
  34           "a gedDefinit ion": "",
  35           "p arentStati on": "",
  36             "createdBy ": " DNS     MBAIAH",
  37           "d ateCreated ": "01/01/ 2017 12:59  PM"
  38       };
  39  
  40           re sponseBody  = null;
  41  
  42           se tResponseB ody(aRespo nseBody) {
  43                    this .responseB ody = aRes ponseBody;
  44           }
  45  
  46           co ntactInfoS ave(body)  {
  47                    retu rn new Obs ervable(ob server =>  observer.n ext(this.r esponseBod y));
  48           }
  49   }
  50  
  51   describe(' StationMai ntenanceAd dContactIn foComponen t', () =>  {
  52     let comp onent: Sta tionMainte nanceAddCo ntactInfoC omponent;
  53     let fixt ure: Compo nentFixtur e<StationM aintenance AddContact InfoCompon ent>;
  54     let stat ionMainten anceAddCon tactInfoSe rvice: Moc kStationMa intenanceA ddContactI nfoService ;
  55  
  56     beforeEa ch(async(( ) => {
  57       TestBe d.configur eTestingMo dule({
  58         decl arations:  [ MenuComp onent, Sta tionMainte nanceAddCo ntactInfoC omponent ] ,
  59         impo rts: [ /*  RouterTest ingModule,  */
  60                             Router TestingMod ule.withRo utes([
  61              { path: 'l ogin', com ponent: St ationMaint enanceAddC ontactInfo Component  /* faking  this for " async" tes t cases to  work */ }
  62           ])
  63           Ht tpModule,  FormsModul e ],
  64         prov iders: [ {  provide:  StationMai ntenanceAd dContactIn foService,  useClass:  MockStati onMaintena nceAddCont actInfoSer vice }, 
  65           Wi ndowRefSer vice,  Edi tStationSe rvice ]
  66       })
  67       .compi leComponen ts();
  68     }));
  69  
  70     beforeEa ch(() => {
  71       fixtur e = TestBe d.createCo mponent(St ationMaint enanceAddC ontactInfo Component) ;
  72       compon ent = fixt ure.compon entInstanc e;
  73  
  74       // Fra nklin Pere z (10/30/2 017): Use  the "TestB ed.get" me thod to ge t the Mock  Service -  not "fixt ure.debugE lement.inj ector.get" .
  75              // station Maintenanc eAddZipCod eService =  fixture.d ebugElemen t.injector .get(MockS tationMain tenanceAdd ZipCodeSer vice);
  76              stationMai ntenanceAd dContactIn foService  = TestBed. get(Statio nMaintenan ceAddConta ctInfoServ ice);
  77       fixtur e.detectCh anges();
  78     });
  79  
  80     it('shou ld be crea ted', () = > {
  81       expect (component ).toBeTrut hy();
  82     });
  83  
  84     it('veri fy "Contac t Name" te xt field e xists', ()  => {
  85       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#contact Name'));
  86       expect (debugElem ent).toBeT ruthy();
  87       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  88       expect (htmlEleme nt).toBeTr uthy();
  89  
  90       expect (htmlEleme nt.getAttr ibute("typ e")).toEqu al("text") ;
  91       expect (htmlEleme nt.tagName ).toEqual( "INPUT");
  92     });
  93  
  94     it('veri fy "Contac t Name" te xt field h as initial ly an empt y string v alue', ()  => {
  95       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#contact Name'));
  96       expect (debugElem ent).toBeT ruthy();
  97       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  98       expect (htmlEleme nt).toBeTr uthy();
  99     
  100       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual("");
  101     });
  102  
  103     it('veri fy "Contac t Name" te xt field h as same va lue as the  "selected ContactNam e" variabl e', () =>  {
  104       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#contact Name'));
  105       expect (debugElem ent).toBeT ruthy();
  106       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  107       expect (htmlEleme nt).toBeTr uthy();
  108     
  109       compon ent.select edContactN ame = "Geo rge Takay" ;
  110       fixtur e.detectCh anges();
  111     
  112       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual(compo nent.selec tedContact Name);
  113     });
  114  
  115     it('veri fy "Contac t Type" te xt field e xists', ()  => {
  116       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#contact Type'));
  117       expect (debugElem ent).toBeT ruthy();
  118       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  119       expect (htmlEleme nt).toBeTr uthy();
  120  
  121       expect (htmlEleme nt.getAttr ibute("typ e")).toEqu al("text") ;
  122       expect (htmlEleme nt.tagName ).toEqual( "INPUT");
  123     });
  124  
  125     it('veri fy "Contac t Type" te xt field i s a requir ed field',  () => {
  126       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#contact Type'));
  127       expect (debugElem ent).toBeT ruthy();
  128       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  129       expect (htmlEleme nt).toBeTr uthy();
  130     
  131       expect (htmlEleme nt.getAttr ibute("req uired")).n ot.toBeNul l();
  132       expect (htmlEleme nt.getAttr ibute("req uired")).t oEqual("") ;
  133     });
  134  
  135     it('veri fy "Contac t Type" te xt field h as initial ly an empt y string v alue', ()  => {
  136       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#contact Type'));
  137       expect (debugElem ent).toBeT ruthy();
  138       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  139       expect (htmlEleme nt).toBeTr uthy();
  140     
  141       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual("");
  142     });
  143  
  144     it('veri fy "Contac t Type" te xt field h as same va lue as the  "selected ContactTyp e" variabl e', () =>  {
  145       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#contact Type'));
  146       expect (debugElem ent).toBeT ruthy();
  147       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  148       expect (htmlEleme nt).toBeTr uthy();
  149     
  150       compon ent.select edContactN ame = "ADD RESS";
  151       fixtur e.detectCh anges();
  152     
  153       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual(compo nent.selec tedContact Type);
  154     });
  155  
  156     it('veri fy "Addres s Line 1"  text field  exists',  () => {
  157       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#address LineOne')) ;
  158       expect (debugElem ent).toBeT ruthy();
  159       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  160       expect (htmlEleme nt).toBeTr uthy();
  161  
  162       expect (htmlEleme nt.getAttr ibute("typ e")).toEqu al("text") ;
  163       expect (htmlEleme nt.tagName ).toEqual( "INPUT");
  164     });
  165  
  166     it('veri fy "Addres s Line 1"  text field  has initi ally an em pty string  value', ( ) => {
  167       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#address LineOne')) ;
  168       expect (debugElem ent).toBeT ruthy();
  169       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  170       expect (htmlEleme nt).toBeTr uthy();
  171     
  172       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual("");
  173     });
  174  
  175     it('veri fy "Addres s Line 1"  text field  has same  value as t he "select edAddressL ineOne" va riable', ( ) => {
  176       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#address LineOne')) ;
  177       expect (debugElem ent).toBeT ruthy();
  178       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  179       expect (htmlEleme nt).toBeTr uthy();
  180     
  181       compon ent.select edAddressL ineOne = " 123 Elm St reet";
  182       fixtur e.detectCh anges();
  183     
  184       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual(compo nent.selec tedAddress LineOne);
  185     });
  186  
  187     it('veri fy "Addres s Line 2"  text field  exists',  () => {
  188       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#address LineTwo')) ;
  189       expect (debugElem ent).toBeT ruthy();
  190       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  191       expect (htmlEleme nt).toBeTr uthy();
  192  
  193       expect (htmlEleme nt.getAttr ibute("typ e")).toEqu al("text") ;
  194       expect (htmlEleme nt.tagName ).toEqual( "INPUT");
  195     });
  196  
  197     it('veri fy "Addres s Line 2"  text field  has initi ally an em pty string  value', ( ) => {
  198       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#address LineTwo')) ;
  199       expect (debugElem ent).toBeT ruthy();
  200       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  201       expect (htmlEleme nt).toBeTr uthy();
  202     
  203       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual("");
  204     });
  205  
  206     it('veri fy "Addres s Line 2"  text field  has same  value as t he "select edAddressL ineTwo" va riable', ( ) => {
  207       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#address LineTwo')) ;
  208       expect (debugElem ent).toBeT ruthy();
  209       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  210       expect (htmlEleme nt).toBeTr uthy();
  211     
  212       compon ent.select edAddressL ineTwo = " Suite 1234 5";
  213       fixtur e.detectCh anges();
  214     
  215       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual(compo nent.selec tedAddress LineTwo);
  216     });
  217  
  218     it('veri fy "City"  text field  exists',  () => {
  219       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#city')) ;
  220       expect (debugElem ent).toBeT ruthy();
  221       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  222       expect (htmlEleme nt).toBeTr uthy();
  223  
  224       expect (htmlEleme nt.getAttr ibute("typ e")).toEqu al("text") ;
  225       expect (htmlEleme nt.tagName ).toEqual( "INPUT");
  226     });
  227  
  228     it('veri fy "City"  text field  has initi ally an em pty string  value', ( ) => {
  229       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#city')) ;
  230       expect (debugElem ent).toBeT ruthy();
  231       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  232       expect (htmlEleme nt).toBeTr uthy();
  233     
  234       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual("");
  235     });
  236  
  237     it('veri fy "City"  text field  has same  value as t he "select edCity" va riable', ( ) => {
  238       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#city')) ;
  239       expect (debugElem ent).toBeT ruthy();
  240       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  241       expect (htmlEleme nt).toBeTr uthy();
  242     
  243       compon ent.select edCity = " Melbourne" ;
  244       fixtur e.detectCh anges();
  245     
  246       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual(compo nent.selec tedCity);
  247     });
  248  
  249     it('veri fy "Zip" t ext field  exists', ( ) => {
  250       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#zipCode '));
  251       expect (debugElem ent).toBeT ruthy();
  252       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  253       expect (htmlEleme nt).toBeTr uthy();
  254  
  255       expect (htmlEleme nt.getAttr ibute("typ e")).toEqu al("text") ;
  256       expect (htmlEleme nt.tagName ).toEqual( "INPUT");
  257     });
  258  
  259     it('veri fy "Zip" t ext field  has initia lly an emp ty string  value', ()  => {
  260       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#zipCode '));
  261       expect (debugElem ent).toBeT ruthy();
  262       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  263       expect (htmlEleme nt).toBeTr uthy();
  264     
  265       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual("");
  266     });
  267  
  268     it('veri fy "Zip" t ext field  has same v alue as th e "selecte dZipCode"  variable',  () => {
  269       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#zipCode '));
  270       expect (debugElem ent).toBeT ruthy();
  271       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  272       expect (htmlEleme nt).toBeTr uthy();
  273     
  274       compon ent.select edZipCode  = "90210";
  275       fixtur e.detectCh anges();
  276     
  277       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual(compo nent.selec tedZipCode );
  278     });
  279  
  280     it('veri fy "Email"  text fiel d exists',  () => {
  281       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#email') );
  282       expect (debugElem ent).toBeT ruthy();
  283       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  284       expect (htmlEleme nt).toBeTr uthy();
  285  
  286       expect (htmlEleme nt.getAttr ibute("typ e")).toEqu al("text") ;
  287       expect (htmlEleme nt.tagName ).toEqual( "INPUT");
  288     });
  289  
  290     it('veri fy "Email"  text fiel d has init ially an e mpty strin g value',  () => {
  291       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#email') );
  292       expect (debugElem ent).toBeT ruthy();
  293       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  294       expect (htmlEleme nt).toBeTr uthy();
  295     
  296       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual("");
  297     });
  298  
  299     it('veri fy "Email"  text fiel d has same  value as  the "selec tedEmail"  variable',  () => {
  300       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#email') );
  301       expect (debugElem ent).toBeT ruthy();
  302       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  303       expect (htmlEleme nt).toBeTr uthy();
  304     
  305       compon ent.select edEmail =  "larry@liv email.com" ;
  306       fixtur e.detectCh anges();
  307     
  308       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual(compo nent.selec tedEmail);
  309     });
  310  
  311     it('veri fy "Fax" t ext field  exists', ( ) => {
  312       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#fax'));
  313       expect (debugElem ent).toBeT ruthy();
  314       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  315       expect (htmlEleme nt).toBeTr uthy();
  316  
  317       expect (htmlEleme nt.getAttr ibute("typ e")).toEqu al("text") ;
  318       expect (htmlEleme nt.tagName ).toEqual( "INPUT");
  319     });
  320  
  321     it('veri fy "Fax" t ext field  has initia lly an emp ty string  value', ()  => {
  322       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#email') );
  323       expect (debugElem ent).toBeT ruthy();
  324       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  325       expect (htmlEleme nt).toBeTr uthy();
  326     
  327       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual("");
  328     });
  329  
  330     it('veri fy "Fax" t ext field  has same v alue as th e "selecte dFax" vari able', ()  => {
  331       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#fax'));
  332       expect (debugElem ent).toBeT ruthy();
  333       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  334       expect (htmlEleme nt).toBeTr uthy();
  335     
  336       compon ent.select edFax = "3 21-678-111 0";
  337       fixtur e.detectCh anges();
  338     
  339       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual(compo nent.selec tedFax);
  340     });
  341  
  342     it('veri fy "Phone"  text fiel d exists',  () => {
  343       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#phone') );
  344       expect (debugElem ent).toBeT ruthy();
  345       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  346       expect (htmlEleme nt).toBeTr uthy();
  347  
  348       expect (htmlEleme nt.getAttr ibute("typ e")).toEqu al("text") ;
  349       expect (htmlEleme nt.tagName ).toEqual( "INPUT");
  350     });
  351  
  352     it('veri fy "Phone"  text fiel d has init ially an e mpty strin g value',  () => {
  353       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#phone') );
  354       expect (debugElem ent).toBeT ruthy();
  355       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  356       expect (htmlEleme nt).toBeTr uthy();
  357     
  358       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual("");
  359     });
  360  
  361     it('veri fy "Phone"  text fiel d has same  value as  the "selec tedPhone"  variable',  () => {
  362       let de bugElement : DebugEle ment = fix ture.debug Element.qu ery(By.css ('#phone') );
  363       expect (debugElem ent).toBeT ruthy();
  364       let ht mlElement:  HTMLEleme nt = debug Element.na tiveElemen t;
  365       expect (htmlEleme nt).toBeTr uthy();
  366     
  367       compon ent.select edPhone =  "321-678-2 000";
  368       fixtur e.detectCh anges();
  369     
  370       expect (htmlEleme nt.getAttr ibute("ng- reflect-mo del")).toE qual(compo nent.selec tedPhone);
  371     });
  372  
  373           it ('verify C ancel butt on exists' , () => {
  374                    let  debugEleme nt: DebugE lement = f ixture.deb ugElement. query(By.c ss('#cance l'));
  375                    expe ct(debugEl ement).toB eTruthy();
  376                    let  htmlElemen t: HTMLEle ment = deb ugElement. nativeElem ent;
  377                    expe ct(htmlEle ment).toBe Truthy();
  378     });
  379     
  380     it('shou ld call "o nClickCanc el" method  when Canc el button  is clicked ', async(( ) => {
  381                    let  debugEleme nt: DebugE lement = f ixture.deb ugElement. query(By.c ss('#cance l'));
  382                    let  htmlElemen t: HTMLEle ment = deb ugElement. nativeElem ent;
  383  
  384                    spyO n(componen t, 'onClic kCancel');
  385  
  386                    html Element.cl ick();
  387  
  388                    fixt ure.whenSt able().the n(() => {
  389                             expect (component .onClickCa ncel).toHa veBeenCall ed();
  390                    });
  391     }));
  392  
  393           it ('should r oute to "s tationMain tanceEdit"  url when  Cancel but ton is cli cked', asy nc(() => {
  394       
  395       const  debugEleme nt: DebugE lement = f ixture.deb ugElement. query(By.c ss('#cance l'));
  396       const  htmlElemen t: HTMLEle ment = deb ugElement. nativeElem ent;
  397       
  398       const  navigateSp y = spyOn( (<any>comp onent).rou ter, 'navi gate');
  399       
  400       htmlEl ement.clic k();
  401       
  402       fixtur e.whenStab le().then( () => {
  403         expe ct(navigat eSpy).toHa veBeenCall edWith(['s tationMain tanceEdit' ]);
  404       })
  405     }));
  406  
  407     it('veri fy Save bu tton exist s', () =>  {
  408                    let  debugEleme nt: DebugE lement = f ixture.deb ugElement. query(By.c ss('#save' ));
  409                    expe ct(debugEl ement).toB eTruthy();
  410                    let  htmlElemen t: HTMLEle ment = deb ugElement. nativeElem ent;
  411                    expe ct(htmlEle ment).toBe Truthy();
  412     });
  413  
  414     it('shou ld call "o nSubmit" m ethod when  Save butt on is clic ked', asyn c(() => {
  415                    let  debugEleme nt: DebugE lement = f ixture.deb ugElement. query(By.c ss('#save' ));
  416                    let  htmlElemen t: HTMLEle ment = deb ugElement. nativeElem ent;
  417  
  418                    spyO n(componen t, 'onSubm it');
  419  
  420                    html Element.cl ick();
  421  
  422                    fixt ure.whenSt able().the n(() => {
  423                             expect (component .onSubmit) .toHaveBee nCalled();
  424                    });
  425     }));
  426  
  427           it ('should r oute to "s tationMain tanceEdit"  url when  Save butto n is click ed and suc cessful ad dition of  Contact In fo has bee n made', a sync(() =>  {
  428                    cons t debugEle ment: Debu gElement =  fixture.d ebugElemen t.query(By .css('#sav e'));
  429                    cons t htmlElem ent: HTMLE lement = d ebugElemen t.nativeEl ement;
  430  
  431                    let  responseBo dy = { "re sult": tru e };
  432                    stat ionMainten anceAddCon tactInfoSe rvice.setR esponseBod y(response Body);
  433  
  434                    cons t navigate Spy = spyO n((<any>co mponent).r outer, 'na vigate');
  435  
  436                    html Element.cl ick();
  437  
  438                    fixt ure.whenSt able().the n(() => {
  439                             expect (navigateS py).toHave BeenCalled With(['sta tionMainta nceEdit']) ;
  440                    })
  441     }));
  442  
  443     it('shou ld display  appropria te Error M essage whe n Save but ton is cli cked and B usiness Lo gic valida tion error  occurs',  () => {
  444                    cons t debugEle ment: Debu gElement =  fixture.d ebugElemen t.query(By .css('#sav e'));
  445                    cons t htmlElem ent: HTMLE lement = d ebugElemen t.nativeEl ement;
  446  
  447                    let  responseBo dy = { "er rorCode":  "Add Conta ct Info er ror", "mes sage": "Va  Facility  '999' is n ot found"  };
  448                    stat ionMainten anceAddCon tactInfoSe rvice.setR esponseBod y(response Body);
  449  
  450                    html Element.cl ick();
  451                    fixt ure.detect Changes();
  452  
  453                    let  addContact InfoErrorM essageDebu gElement:  DebugEleme nt = fixtu re.debugEl ement.quer y(By.css(' #addContac tInfoError Message')) ;
  454                    expe ct(addCont actInfoErr orMessageD ebugElemen t).toBeTru thy();
  455                    let  addContact InfoErrorM essageHtml Element: H TMLElement  = addCont actInfoErr orMessageD ebugElemen t.nativeEl ement;
  456                    expe ct(addCont actInfoErr orMessageH tmlElement ).toBeTrut hy();
  457  
  458       expect (component .addContac tInfoError Message.le ngth).toEq ual(1);
  459       expect (addContac tInfoError MessageHtm lElement.i nnerText). toContain( responseBo dy.errorCo de);
  460       expect (addContac tInfoError MessageHtm lElement.i nnerText). toContain( responseBo dy.message );
  461     });
  462  
  463     it('shou ld display  appropria te Error M essage whe n Save but ton is cli cked and R equest Bod y validati on error o ccurs', ()  => {
  464                    cons t debugEle ment: Debu gElement =  fixture.d ebugElemen t.query(By .css('#sav e'));
  465                    cons t htmlElem ent: HTMLE lement = d ebugElemen t.nativeEl ement;
  466  
  467                    let  responseBo dy = [ { " errorCode" : "ERR", " entity": " vaFacility Cd", "mess age": "may  not be nu ll" } ]
  468                    stat ionMainten anceAddCon tactInfoSe rvice.setR esponseBod y(response Body);
  469  
  470                    html Element.cl ick();
  471                    fixt ure.detect Changes();
  472  
  473                    let  addContact InfoErrorM essageDebu gElement:  DebugEleme nt = fixtu re.debugEl ement.quer y(By.css(' #addContac tInfoError Message')) ;
  474                    expe ct(addCont actInfoErr orMessageD ebugElemen t).toBeTru thy();
  475                    let  addContact InfoErrorM essageHtml Element: H TMLElement  = addCont actInfoErr orMessageD ebugElemen t.nativeEl ement;
  476                    expe ct(addCont actInfoErr orMessageH tmlElement ).toBeTrut hy();
  477  
  478       expect (component .addContac tInfoError Message.le ngth).toEq ual(1);
  479       expect (addContac tInfoError MessageHtm lElement.i nnerText). toContain( responseBo dy[0].erro rCode);
  480       expect (addContac tInfoError MessageHtm lElement.i nnerText). toContain( responseBo dy[0].enti ty);
  481       expect (addContac tInfoError MessageHtm lElement.i nnerText). toContain( responseBo dy[0].mess age);
  482     });
  483  
  484   });