Skip to main content

All Questions

1 vote
1 answer
74 views

How to write unit test case for reactive form in angular 18

I am new for unit test case in angular.I am trying to write unit test case for angular reactive fomr. But, It is not working properly. Getting below error some times Error: NG01052: formGroup expects ...
Goutm's user avatar
  • 43
0 votes
0 answers
19 views

How to get NGRX reducer state value inside spec ts file in angular 16

I am not able to get reducer state value inside spec ts. Getting below error. An error was thrown in afterAll TypeError: Cannot read properties of undefined (reading 'isLoading') app.component.ts: ...
Goutm's user avatar
  • 43
2 votes
1 answer
76 views

How to write unit test case for angular code

I am trying to to write test case for my angular project. I am using angular version 16. Below is my code. In my code I am not getting component.appRuleList and component.appRuleOptions values in my ...
Goutm's user avatar
  • 43
1 vote
0 answers
10 views

How to resolve setFormControlValue issue in angular

I am getting below the error in the test case error in my angular 16 application. Error: NG0302: The pipe 'setFormControlValue' could not be found in the 'AppComponent' component. Verify that it is ...
Goutm's user avatar
  • 43
0 votes
1 answer
253 views

Jasmine Karma not working Angular 16 upgrade

I have upgraded angular from 15 to 16 but when I run ng test, it is not including any component.spec.ts files and it fails all the test cases: package.json: "karma": "6.3.17", ...
Pathik Vejani's user avatar
0 votes
0 answers
69 views

Angular 16 Test case fails - was thrown in afterAll

Migrated the Angualr application from 6 to 16 and the test cases failing with below errors. enter image description here Package.json enter image description here Karma.js enter image description here ...
Prabhu's user avatar
  • 1
2 votes
1 answer
2k views

Writing unit tests for simple Angular functions which using inject() method in Angular 16

After Angular CanActivate interface became deprecated, I've changed my guards for simple const functions based on official documentation. For example here is my inverseAuthGuard method, which seems ...
faklyasgy's user avatar
  • 848
0 votes
1 answer
261 views

Jasmine test case for checkbox event handler Angular 16, jasmine 4.3.5

I have to test below function addAll($event: any) { this.Deletion = []; if ($event['srcElement']['checked']) { this.Model.forEach(file => { this.Deletion.push(file.docId); ...
Sagar's user avatar
  • 158