You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it("should have a h1",()=>{consth1=fixture.nativeElement.querySelector("h1");expect(h1).toBeTruthy();expect(h1.textContent).toContain("Forbidden");});it('h1 content should be "forbidden"',()=>{consth1=fixture.nativeElement.querySelector("h1");expect(h1.textContent).toMatch(/forbidden/i);});
it("should have a button to the home page",()=>{constbutton=fixture.nativeElement.querySelector("button");expect(button).toBeTruthy();});it('button text should be "go to the home page"',()=>{constbutton=fixture.nativeElement.querySelector("button");expect(button.textContent).toMatch(/gotothehomepage/i);});it("click on button shuld be trigger the onHomeClick method",()=>{constbutton=fixture.nativeElement.querySelector("button");spyOn(component,"onHomeClick");button.click();expect(component.onHomeClick).toHaveBeenCalled();});
it("customer should be the first customer in the list",()=>{component.id=1;component.ngOnInit();setTimeout(()=>{expect(component.customer()).toBe(component.store.list()[0]);});});