@@ -5,35 +5,49 @@ import { render } from '../src/public_api';
55
66@Component ( {
77 selector : 'fixture' ,
8- template : `` ,
8+ template : `
9+ <input type="text" data-testid="input" />
10+ <button>button</button>
11+ ` ,
912} )
1013class FixtureComponent { }
1114
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+
1223@NgModule ( {
1324 declarations : [ FixtureComponent ] ,
1425} )
1526export 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+ } ) ;
2133 } ) ;
2234} ) ;
2335
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 ( ) ;
3341 } ) ;
3442
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+ } ) ;
3747
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+ } ) ;
3953} ) ;
0 commit comments