File tree 1 file changed +27
-0
lines changed
projects/testing-library/tests/issues
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { HttpClient , provideHttpClient } from '@angular/common/http' ;
2
+ import { provideHttpClientTesting } from '@angular/common/http/testing' ;
3
+ import { Component , input } from '@angular/core' ;
4
+ import { render , screen } from '../../src/public_api' ;
5
+
6
+ test ( 'succeeds' , async ( ) => {
7
+ await render ( DummyComponent , {
8
+ inputs : {
9
+ value : 'test' ,
10
+ } ,
11
+ providers : [ provideHttpClientTesting ( ) , provideHttpClient ( ) ] ,
12
+ } ) ;
13
+
14
+ expect ( screen . getByText ( 'test' ) ) . toBeVisible ( ) ;
15
+ } ) ;
16
+
17
+ @Component ( {
18
+ selector : 'atl-dummy' ,
19
+ standalone : true ,
20
+ imports : [ ] ,
21
+ template : '<p>{{ value() }}</p>' ,
22
+ } )
23
+ class DummyComponent {
24
+ value = input . required < string > ( ) ;
25
+ // @ts -ignore
26
+ constructor ( private http : HttpClient ) { }
27
+ }
You can’t perform that action at this time.
0 commit comments