55 questions
2
votes
1
answer
20
views
Angular number pipe + Jest + Angular testing library. Whitespace is not equal to whitespace?
Can anybody help me to figure this out please ?
Im trying to test a number value in my dom. It is the result of complex calculation.
It is formatted in french locale, cause application is french.
Used ...
0
votes
1
answer
25
views
Global propery in JSDOM not being set in integration test (angular-testing-library)
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-...
0
votes
1
answer
41
views
How to render `<ng-container *ngTemplateOutlet="someTemplate" />` when using testing library and MockBuilder?
We use the testing library and MockBuilder from ng-mocks to write unit tests for angular components:
...
<ng-container *ngTemplateOutlet="previewContent" />
...
<!-- Preview ...
0
votes
1
answer
82
views
Angular -Access route param require input in tests when using using with component input binding
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 ...
0
votes
1
answer
114
views
How to work with Angular Query adapter from Tanstack tests
I am working with Angular Query with Angular v19 and signals. I was able to implement good solution to work with QueryOptions and injectQuery in the app. How ever it's quite challenging to work with ...
0
votes
0
answers
26
views
How to test Angular Ag grid with Angular testing library?
I am looking for example implementations on Angular ag grid testing with Angular testing library but could not get any reference. What is the best way to test using ATL?
0
votes
1
answer
511
views
Angular Unit testing: How to pass multiple files through include while running ng test from CLI?
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": {
...
"...
-1
votes
1
answer
591
views
BDD based testing framework/library for testing frontend behaviour in Angular?
First of all, I looked at another question,
BDD framework for the frontend. The question has gone on entirely different direction.
BDD is not about Cucumber or Plain english tests names. (Jasmine/...
0
votes
1
answer
931
views
testing an Angular component with a ngrx store, not causing actions to be triggered
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 ...
0
votes
1
answer
437
views
Using Jest/angular-testing-library to test eventEmitter subscription return
I am coding with Angular and am attempting to write a test for the below function. We are not using the built in test and are using Jest with the angular-testing-library. When I run the test, I am not ...
5
votes
1
answer
2k
views
Angular 14 + Jest - typescript_1.default.canHaveDecorators is not a function
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....
0
votes
1
answer
176
views
how can I test a component that have a function that use async await?
I have a problem.
I have a function that use a async await to get data, but in the moment that I try test it. I don't know how to do that.
I tried this
this is my component
async loadTodos() {
try ...
0
votes
1
answer
74
views
how to get the property of behaivourSubject type property of a service ?, angular testing
I have a service like
export class TestService {
public props: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
props$ = this.props.asObservable();
test(){
}
}
...
2
votes
1
answer
703
views
The fireEvent.click() from @testing-library/angular not working for 'ion-button' component but works for normal button
I am developing an application with Ionic Angular. While I am testing with @testing-library/angular, the test is not working for ion-button but works for normal button field. What could be the problem?...
1
vote
1
answer
94
views
Error in tests with Angular 6 and Jest - TypeError: testing.TestBed.inject is not a function
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:
...