@@ -19,7 +19,7 @@ import { render, fireEvent, screen } from '../src/public_api';
19
19
<button>button</button>
20
20
` ,
21
21
} )
22
- class FixtureComponent { }
22
+ class FixtureComponent { }
23
23
24
24
test ( 'creates queries and events' , async ( ) => {
25
25
const view = await render ( FixtureComponent ) ;
@@ -50,46 +50,46 @@ describe('standalone', () => {
50
50
51
51
describe ( 'standalone with child' , ( ) => {
52
52
@Component ( {
53
- selector : 'child-fixture' ,
53
+ selector : 'atl- child-fixture' ,
54
54
template : `<span>A child fixture</span>` ,
55
55
standalone : true ,
56
56
} )
57
- class ChildFixture { }
57
+ class ChildFixtureComponent { }
58
58
59
59
@Component ( {
60
- selector : 'child-fixture' ,
60
+ selector : 'atl- child-fixture' ,
61
61
template : `<span>A mock child fixture</span>` ,
62
62
standalone : true ,
63
63
} )
64
- class MockChildFixture { }
64
+ class MockChildFixtureComponent { }
65
65
66
66
@Component ( {
67
- selector : 'parent-fixture' ,
67
+ selector : 'atl- parent-fixture' ,
68
68
template : `<h1>Parent fixture</h1>
69
- <div><child-fixture></child-fixture></div> ` ,
69
+ <div><atl- child-fixture></atl- child-fixture></div> ` ,
70
70
standalone : true ,
71
- imports : [ ChildFixture ] ,
71
+ imports : [ ChildFixtureComponent ] ,
72
72
} )
73
- class ParentFixture { }
73
+ class ParentFixtureComponent { }
74
74
75
75
it ( 'renders the standalone component with child' , async ( ) => {
76
- await render ( ParentFixture ) ;
77
- expect ( screen . getByText ( 'Parent fixture' ) ) ;
78
- expect ( screen . getByText ( 'A child fixture' ) ) ;
76
+ await render ( ParentFixtureComponent ) ;
77
+ expect ( screen . getByText ( 'Parent fixture' ) ) . toBeInTheDocument ( ) ;
78
+ expect ( screen . getByText ( 'A child fixture' ) ) . toBeInTheDocument ( ) ;
79
79
} ) ;
80
80
81
- it ( 'renders the standalone component with child' , async ( ) => {
82
- await render ( ParentFixture , { ɵcomponentImports : [ MockChildFixture ] } ) ;
83
- expect ( screen . getByText ( 'Parent fixture' ) ) ;
84
- expect ( screen . getByText ( 'A mock child fixture' ) ) ;
81
+ it ( 'renders the standalone component with a mocked child' , async ( ) => {
82
+ await render ( ParentFixtureComponent , { componentImports : [ MockChildFixtureComponent ] } ) ;
83
+ expect ( screen . getByText ( 'Parent fixture' ) ) . toBeInTheDocument ( ) ;
84
+ expect ( screen . getByText ( 'A mock child fixture' ) ) . toBeInTheDocument ( ) ;
85
85
} ) ;
86
86
87
87
it ( 'rejects render of template with componentImports set' , ( ) => {
88
- const result = render ( `<div><parent-fixture></parent-fixture></div>` , {
89
- imports : [ ParentFixture ] ,
90
- ɵcomponentImports : [ MockChildFixture ] ,
88
+ const view = render ( `<div><atl- parent-fixture></atl- parent-fixture></div>` , {
89
+ imports : [ ParentFixtureComponent ] ,
90
+ componentImports : [ MockChildFixtureComponent ] ,
91
91
} ) ;
92
- return expect ( result ) . rejects . toMatchObject ( { message : / E r r o r w h i l e r e n d e r i n g / } ) ;
92
+ return expect ( view ) . rejects . toMatchObject ( { message : / E r r o r w h i l e r e n d e r i n g / } ) ;
93
93
} ) ;
94
94
} ) ;
95
95
@@ -117,7 +117,7 @@ describe('animationModule', () => {
117
117
@NgModule ( {
118
118
declarations : [ FixtureComponent ] ,
119
119
} )
120
- class FixtureModule { }
120
+ class FixtureModule { }
121
121
describe ( 'excludeComponentDeclaration' , ( ) => {
122
122
it ( 'does not throw if component is declared in an imported module' , async ( ) => {
123
123
await render ( FixtureComponent , {
0 commit comments