Skip to main content
1 vote
1 answer
55 views

Running this unit test in Angular 21 always fails with the following error: × should toggle showSettings when settings button is clicked (440231 ms) ● DrawerComponent › should launch settings ...
bob.mazzo's user avatar
  • 5,789
0 votes
1 answer
55 views

In my Angular app I need to be able to unit test that routerLink create the correct href attribute. Sometimes they are links relative to the current route, and sometimes they are absolute links from ...
Chris Barr's user avatar
  • 34.7k
3 votes
1 answer
1k views

I have a Service which contains a resource (for a list of country-objects). Unit-testing the usual way seems not to work, even with fakeAsync and tick. Changes on the Subject which feeds the request-...
hgoebl's user avatar
  • 13.1k
0 votes
0 answers
35 views

I have a simple Angular 19 component that will make multiple requests for SVG files, and then insert them into a component @Component({ selector: 'app-custom-svg-images', imports: [AsyncPipe], ...
Chris Barr's user avatar
  • 34.7k
-1 votes
1 answer
750 views

I have an application, which was generated with Angular CLI v19 and uses the application builder. The application builds and works perfectly fine, however when running ng test, I get a new error: ...
JSON Derulo's user avatar
  • 18.8k
1 vote
0 answers
75 views

I am trying to create unit test case for the below code, export class TestService { currentContent$ = this.getContent().pipe( distinctUntilChanged((p, c) => isEqual(p, c)) ); ...
Smita's user avatar
  • 11
0 votes
1 answer
407 views

I am trying to test mat snackbar. I have following code in my component.ts snackbarRef: MatSnackBarRef<TextOnlySnackBar>; constructor(private snackBar: MatSnackBar) {} onUpdate(){ this....
StaticName's user avatar
2 votes
1 answer
1k views

After updating my Angular project (including Angular Material) to v19, I am getting new errors like the following in my unit tests: NullInjectorError: R3InjectorError(Standalone[MyComponent])[...
JSON Derulo's user avatar
  • 18.8k
8 votes
2 answers
2k views

I have generated a fresh Angular 18 project and made it zoneless. It works fine, however in all of my unit tests I am now getting the following error: Error: NG0908: In this configuration Angular ...
JSON Derulo's user avatar
  • 18.8k
1 vote
1 answer
292 views

I'm facing this error when I try to run test in an Angular project: NavigationMainComponent › should create TypeError: Cannot read properties of undefined (reading 'subscribe') at ...
Valentina Maronese's user avatar
3 votes
1 answer
1k views

I am using Angular's signal queries (viewChild, viewChildren, contentChild, contentChildren) like the following: export class MyComponent { myScrollContainer = viewChild('scrollContainer', { read: ...
JSON Derulo's user avatar
  • 18.8k
2 votes
0 answers
217 views

I am using Angular signal and to execute change in signal using effect function. How to mock signal to trigger effect during unit test. import { effect, Injector, Signal } from '@angular/core'; ...
Jack Nil's user avatar
0 votes
0 answers
120 views

I am getting following error when ran the unit tests in pipeline for an Angular app. Error: Timeout - Async function did not complete within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL) ...
Mahesh Dharwad's user avatar
3 votes
1 answer
10k views

I have an application using Angular 18, and I have one component that uses a service. That service calls HttpClient, gets a list of entities and the component uses that on the constructor. The unit ...
Luiz Gustavo Mendes's user avatar
1 vote
0 answers
2k views

We upgraded our Angular application from version 16 to 18. After the upgrade, our unit tests started failing with the following error: Error: NG0205: Injector has already been destroyed. in http://...
Nirbhay Singh's user avatar

15 30 50 per page
1
2 3 4 5
19