1it('should display the Add photo modal when the button is clicked and logged in', () => {
2
3 let pub = {
4 phone: '123123'
5 }
6
7 component.pub = pub;
8 let authService = fixture.debugElement.injector.get(AuthService);
9
10 authService.loginWithEmail();
11 fixture.detectChanges();
12
13 expect(authService.authenticated).toBe(true);
14
15
16 let modal = fixture.debugElement.injector.get(Modal);
17 spyOn(modal, 'present');
18 debugElementArray = helper.getAllByCss(fixture, 'ion-col button');
19
20 debugElementArray[0].triggerEventHandler('click', null);
21 expect(modal.present).toHaveBeenCalled();
22
23});