1
1
import { Component } from '@angular/core' ;
2
2
import { TestBed } from '@angular/core/testing' ;
3
+ import { fireEvent , render } from '@testing-library/angular' ;
3
4
4
5
import { createMock , provideMock , Mock } from '../src/public_api' ;
5
- import { render , fireEvent } from '../../testing-library/src/public_api' ;
6
6
7
7
class FixtureService {
8
8
constructor ( private foo : string , public bar : string ) { }
@@ -13,10 +13,10 @@ class FixtureService {
13
13
}
14
14
15
15
@Component ( {
16
- selector : 'fixture' ,
16
+ selector : 'atl- fixture' ,
17
17
template : ` <button (click)="print()">Print</button> ` ,
18
18
} )
19
- export class FixtureComponent {
19
+ class FixtureComponent {
20
20
constructor ( private service : FixtureService ) { }
21
21
22
22
print ( ) {
@@ -39,6 +39,7 @@ it('provides a mock service', async () => {
39
39
expect ( service . print ) . toHaveBeenCalledTimes ( 1 ) ;
40
40
} ) ;
41
41
42
+ // eslint-disable-next-line jest/expect-expect
42
43
it ( 'is possible to write a mock implementation' , async ( done ) => {
43
44
const { getByText } = await render ( FixtureComponent , {
44
45
providers : [ provideMock ( FixtureService ) ] ,
0 commit comments