@@ -5,35 +5,49 @@ import { render } from '../src/public_api';
5
5
6
6
@Component ( {
7
7
selector : 'fixture' ,
8
- template : `` ,
8
+ template : `
9
+ <input type="text" data-testid="input" />
10
+ <button>button</button>
11
+ ` ,
9
12
} )
10
13
class FixtureComponent { }
11
14
15
+ test ( 'creates queries and events' , async ( ) => {
16
+ const component = await render ( FixtureComponent ) ;
17
+
18
+ component . input ( component . getByTestId ( 'input' ) , { target : { value : 'a super awesome input' } } ) ;
19
+ component . getByDisplayValue ( 'a super awesome input' ) ;
20
+ component . click ( component . getByText ( 'button' ) ) ;
21
+ } ) ;
22
+
12
23
@NgModule ( {
13
24
declarations : [ FixtureComponent ] ,
14
25
} )
15
26
export class FixtureModule { }
16
-
17
- test ( 'should not throw if component is declared in an import' , async ( ) => {
18
- await render ( FixtureComponent , {
19
- imports : [ FixtureModule ] ,
20
- excludeComponentDeclaration : true ,
27
+ describe ( 'excludeComponentDeclaration' , ( ) => {
28
+ test ( 'should not throw if component is declared in an import' , async ( ) => {
29
+ await render ( FixtureComponent , {
30
+ imports : [ FixtureModule ] ,
31
+ excludeComponentDeclaration : true ,
32
+ } ) ;
21
33
} ) ;
22
34
} ) ;
23
35
24
- test ( 'should add NoopAnimationsModule by default' , async ( ) => {
25
- await render ( FixtureComponent ) ;
26
- const noopAnimationsModule = TestBed . get < NoopAnimationsModule > ( NoopAnimationsModule ) ;
27
- expect ( noopAnimationsModule ) . toBeDefined ( ) ;
28
- } ) ;
29
-
30
- test ( 'should not add NoopAnimationsModule if BrowserAnimationsModule is an import' , async ( ) => {
31
- await render ( FixtureComponent , {
32
- imports : [ BrowserAnimationsModule ] ,
36
+ describe ( 'animationModule' , ( ) => {
37
+ test ( 'should add NoopAnimationsModule by default' , async ( ) => {
38
+ await render ( FixtureComponent ) ;
39
+ const noopAnimationsModule = TestBed . get < NoopAnimationsModule > ( NoopAnimationsModule ) ;
40
+ expect ( noopAnimationsModule ) . toBeDefined ( ) ;
33
41
} ) ;
34
42
35
- const browserAnimationsModule = TestBed . get < BrowserAnimationsModule > ( BrowserAnimationsModule ) ;
36
- expect ( browserAnimationsModule ) . toBeDefined ( ) ;
43
+ test ( 'should not add NoopAnimationsModule if BrowserAnimationsModule is an import' , async ( ) => {
44
+ await render ( FixtureComponent , {
45
+ imports : [ BrowserAnimationsModule ] ,
46
+ } ) ;
37
47
38
- expect ( ( ) => TestBed . get < NoopAnimationsModule > ( NoopAnimationsModule ) ) . toThrow ( ) ;
48
+ const browserAnimationsModule = TestBed . get < BrowserAnimationsModule > ( BrowserAnimationsModule ) ;
49
+ expect ( browserAnimationsModule ) . toBeDefined ( ) ;
50
+
51
+ expect ( ( ) => TestBed . get < NoopAnimationsModule > ( NoopAnimationsModule ) ) . toThrow ( ) ;
52
+ } ) ;
39
53
} ) ;
0 commit comments