Skip to main content
Filter by
Sorted by
Tagged with
Advice
1 vote
1 replies
101 views

I am a bit confused with the Angular testing landscape. I have seen that Vitest will become the new default, replacing Karma. The question I then have is what about Jasmine. Does Vitest replace only ...
Maarten's user avatar
  • 11
0 votes
1 answer
49 views

I'm not able to set up my testing-library integration tests so they recognize the global interface with the third party static methods from my component library Preline UI I'm using JSDOM and angular-...
Florestan Korp's user avatar
0 votes
1 answer
95 views

I am using Angular 18 with Angular testing library: my issues is that I am able access route param as required input signal. However when I run the tests that depends on this input it's complaining ...
Eternal Sunshine's user avatar
0 votes
1 answer
645 views

I am using ng test to run my unit tests. I have a scenario where I need to test mutliple spec files which are in different paths. I am able to do this using angular.json "test": { ... "...
Naveen kumar S's user avatar
0 votes
1 answer
1k views

I have a few angular components that I want to test and make sure that they are working. The idea of the component in it's simplest form is to list datapoints. Each of these datapoints should be ...
munHunger's user avatar
  • 3,117
5 votes
1 answer
2k views

After configuring Jest with Angular 14, I'm getting this error: Test suite failed to run TypeError: typescript_1.default.canHaveDecorators is not a function at TypeScriptReflectionHost....
StefanP's user avatar
  • 925
0 votes
1 answer
81 views

I have a service like export class TestService { public props: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false); props$ = this.props.asObservable(); test(){ } } ...
Ricardo Tovar's user avatar
1 vote
1 answer
101 views

When running the tests on my project when trying to render the component, the tests fail with the following error: TypeError: testing.TestBed.inject is not a function This is the test component: ...
Felipe Ignacio Moyano carreño's user avatar
0 votes
1 answer
2k views

Hi I trying to test http request but , when I call a function in the ngOnInit it show me that message "cannot read properties of undefined" can somebody help me? this is my test it('xxxx',...
Ricardo Tovar's user avatar
1 vote
1 answer
2k views

I have a component that emit a value when call to a function, how can I test if the @output emit a value ? this is my function @Output() emitDetail = new EventEmitter(); emitDetailFn() { this....
SirRiT003's user avatar
  • 193
1 vote
0 answers
292 views

I am retrive the passing value to MAT_DIALOG_DATA any one help me? spec.ts: test('should check component data', async () => { const { fixture } = await render(PrintPopupComponent, { ...
3gwebtrain's user avatar
  • 15.5k
1 vote
1 answer
2k views

I have an ag-grid that contains different columns and column groups, as well as row groups. I am trying to test the DOM elements displayed in the row group using Jest and Angular Testing Library. The ...
Zaid's user avatar
  • 385
1 vote
1 answer
2k views

Let's suppose I have the following component: @Component({ selector: 'app-dumb', template: '<button (click)="increment()">Increment</button>' }) export class ...
th3n3rd's user avatar
  • 374
0 votes
1 answer
24 views

I have the following services: @Injectable({ providedIn: 'root' }) export class Service1 { dataHasChanged = new Subject(); private data1; private data2; constructor() {} getData() { ...
asotos's user avatar
  • 347
4 votes
2 answers
4k views

I am trying to test an Angular app with testing-library/angular@11 and [email protected] which uses custom-elements quite heavily. Unfortunately I am not quite sure if testing-library/JSDOM/Jest just don't ...
felix's user avatar
  • 81
2 votes
1 answer
1k views

The gridReady method of the Angular AG Grid is not being called in the Jest tests. Do you know why? Here you have my test code: import {TestBed} from "@angular/core/testing"; import {...
Jöcker's user avatar
  • 7,048
1 vote
1 answer
513 views

I am using angular-testing-library for my component testing. when expect for fail, after setting the value, my test case not failing. any one help me? (title,newTitle - @inputs) import { render, ...
user2024080's user avatar
  • 5,161
1 vote
1 answer
1k views

I have the below list of companies populated in an ng-select: <div class="input-group"> <ng-select role="company" id="company" class="form-control" ...
avdeveloper's user avatar
0 votes
1 answer
325 views

I have the <mat-paginator> element working fine, I just want to know how the heck to I test the getPaginatorData method for the (page) attribute with the @testing-library/angular library? <...
John's user avatar
  • 179
0 votes
1 answer
2k views

I have a Component that uses mat-menu from Angular Material UI. When I call fireEvent.click(), I get an error: TestingLibraryElementError: Unable to find role="menu" in console. This is my ...
aditya's user avatar
  • 3
2 votes
0 answers
168 views

I had a problem with angular testing. I want to detect when an url change on a button click. I followed a lot of similar issues on stack but can't achieve to my goal since 1 one week :/ Explanation ...
iStornZ's user avatar
  • 908
27 votes
3 answers
16k views

I love testing-library, have used it a lot in a React project, and I'm trying to use it in an Angular project now - but I've always struggled with the enormous error output, including the HTML text of ...
Ian G's user avatar
  • 5,593
7 votes
0 answers
812 views

In my Angular app I have a <select> bound to a reactive form like the following: <form [formGroup]="myForm"> <select formControlName="myControlName" id="my-...
Francesco Borzi's user avatar
7 votes
1 answer
2k views

I am just trying out this library and seem to be unable to access elements by their ARIA role. I use angular 10.0.6, jest 26.2.1 together with jest-preset-angular 8.2.1 and @testing-library/angular 10....
Chris's user avatar
  • 438
0 votes
0 answers
105 views

I am using @testing-library to test my React project which uses Material-UI as it's main UI library. As @testing-library suggests, it's main philosophy is to test the application in the exact same way ...
Ardeshir Izadi's user avatar