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
I saw your ClickerForm which helps a lot to understand about testing forms in ionic.I have certain queries which I have not understood, please help me.
it('passes new clicker through to service', () => {
let clickerName: string = 'dave';
instance.form = new FormBuilder().group({clickerNameInput: [clickerName]});
spyOn(instance, 'newClicker').and.callThrough();
spyOn(instance['clickerService'], 'newClicker').and.callThrough();
fixture.detectChanges();
fixture.nativeElement.querySelectorAll('button')[0].click(); **//not understood!!!**
expect(instance.newClicker).toHaveBeenCalledWith(Object({ clickerNameInput: clickerName }));
expect(instance['clickerService'].newClicker).toHaveBeenCalledWith(clickerName);
});
I have written a comment in the line which is third last, please explain me the function of querySelectorAll on the button and [0].
Secondly, I wrote some lines of code following yours but, but got an error stating- Expected spy onSubmit to have been called with [ Object({ name: 'Aditya', email: 'test@aaa.com' }) ]but it was never called.
Hi,
I am not able to ask questions on stack overflow due to exceeding asking questions limit.
Please help if it is possible, it will be very helpful and will add some knowledge.
Hi Lathonez,
I saw your ClickerForm which helps a lot to understand about testing forms in ionic.I have certain queries which I have not understood, please help me.
I have written a comment in the line which is third last, please explain me the function of
querySelectorAll
on thebutton
and[0]
.Secondly, I wrote some lines of code following yours but, but got an error stating-
Expected spy onSubmit to have been called with [ Object({ name: 'Aditya', email: 'test@aaa.com' }) ]
but it was never called.
form.ts
form.spec.ts
Lastly, Can't we have a use case for input fields and validators and submit button?
Thank you
The text was updated successfully, but these errors were encountered: