@@ -117,20 +117,20 @@ export class CounterComponent {
117
117
counter.component.spec.ts
118
118
119
119
``` typescript
120
- import { render } from ' @testing-library/angular' ;
120
+ import { render , screen } from ' @testing-library/angular' ;
121
121
import CounterComponent from ' ./counter.component.ts' ;
122
122
123
123
describe (' Counter' , () => {
124
124
test (' should render counter' , async () => {
125
- const { getByText } = await render (CounterComponent , { componentProperties: { counter: 5 } });
125
+ await render (CounterComponent , { componentProperties: { counter: 5 } });
126
126
127
- expect (getByText (' Current Count: 5' ));
127
+ expect (screen . getByText (' Current Count: 5' ));
128
128
});
129
129
130
130
test (' should increment the counter on click' , async () => {
131
- const { getByText, click } = await render (CounterComponent , { componentProperties: { counter: 5 } });
131
+ const { click } = await render (CounterComponent , { componentProperties: { counter: 5 } });
132
132
133
- click (getByText (' +' ));
133
+ click (screen . getByText (' +' ));
134
134
135
135
expect (getByText (' Current Count: 6' ));
136
136
});
@@ -179,17 +179,22 @@ light-weight, simple, and understandable.
179
179
Thanks goes to these people ([ emoji key] [ emojis ] ):
180
180
181
181
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
182
- <!-- prettier-ignore -->
182
+ <!-- prettier-ignore-start -->
183
+ <!-- markdownlint-disable -->
183
184
<table >
184
185
<tr >
185
- <td align="center"><a href="http://timdeschryver.dev"><img src="https://avatars1.githubusercontent.com/u/28659384?v=4" width="100px;" alt="Tim Deschryver"/><br /><sub><b>Tim Deschryver</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/commits?author=timdeschryver" title="Code">💻</a> <a href="https://github.com/testing-library/angular-testing-library/commits?author=timdeschryver" title="Documentation">📖</a> <a href="#infra-timdeschryver" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/testing-library/angular-testing-library/commits?author=timdeschryver" title="Tests">⚠️</a></td>
186
- <td align="center"><a href="https://michaeldeboey.be"><img src="https://avatars3.githubusercontent.com/u/6643991?v=4" width="100px;" alt="Michaël De Boey"/><br /><sub><b>Michaël De Boey</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/commits?author=MichaelDeBoey" title="Documentation">📖</a></td>
187
- <td align="center"><a href="https://github.com/flakolefluk"><img src="https://avatars0.githubusercontent.com/u/11986564?v=4" width="100px;" alt="Ignacio Le Fluk"/><br /><sub><b>Ignacio Le Fluk</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/commits?author=flakolefluk" title="Code">💻</a> <a href="https://github.com/testing-library/angular-testing-library/commits?author=flakolefluk" title="Tests">⚠️</a></td>
188
- <td align="center"><a href="https://hu.linkedin.com/pub/tamas-szabo/57/a4b/242"><img src="https://avatars0.githubusercontent.com/u/3720079?v=4" width="100px;" alt="Tamás Szabó"/><br /><sub><b>Tamás Szabó</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/commits?author=szabototo89" title="Code">💻</a></td>
189
- <td align="center"><a href="https://medium.com/@gregor.woiwode"><img src="https://avatars3.githubusercontent.com/u/444278?v=4" width="100px;" alt="Gregor Woiwode"/><br /><sub><b>Gregor Woiwode</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/commits?author=GregOnNet" title="Code">💻</a></td>
186
+ <td align="center"><a href="http://timdeschryver.dev"><img src="https://avatars1.githubusercontent.com/u/28659384?v=4" width="100px;" alt=""/><br /><sub><b>Tim Deschryver</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/commits?author=timdeschryver" title="Code">💻</a> <a href="https://github.com/testing-library/angular-testing-library/commits?author=timdeschryver" title="Documentation">📖</a> <a href="#infra-timdeschryver" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/testing-library/angular-testing-library/commits?author=timdeschryver" title="Tests">⚠️</a></td>
187
+ <td align="center"><a href="https://michaeldeboey.be"><img src="https://avatars3.githubusercontent.com/u/6643991?v=4" width="100px;" alt=""/><br /><sub><b>Michaël De Boey</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/commits?author=MichaelDeBoey" title="Documentation">📖</a></td>
188
+ <td align="center"><a href="https://github.com/flakolefluk"><img src="https://avatars0.githubusercontent.com/u/11986564?v=4" width="100px;" alt=""/><br /><sub><b>Ignacio Le Fluk</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/commits?author=flakolefluk" title="Code">💻</a> <a href="https://github.com/testing-library/angular-testing-library/commits?author=flakolefluk" title="Tests">⚠️</a></td>
189
+ <td align="center"><a href="https://hu.linkedin.com/pub/tamas-szabo/57/a4b/242"><img src="https://avatars0.githubusercontent.com/u/3720079?v=4" width="100px;" alt=""/><br /><sub><b>Tamás Szabó</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/commits?author=szabototo89" title="Code">💻</a></td>
190
+ <td align="center"><a href="https://medium.com/@gregor.woiwode"><img src="https://avatars3.githubusercontent.com/u/444278?v=4" width="100px;" alt=""/><br /><sub><b>Gregor Woiwode</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/commits?author=GregOnNet" title="Code">💻</a></td>
191
+ <td align="center"><a href="https://github.com/tonivj5"><img src="https://avatars2.githubusercontent.com/u/7110786?v=4" width="100px;" alt=""/><br /><sub><b>Toni Villena</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/issues?q=author%3Atonivj5" title="Bug reports">🐛</a> <a href="https://github.com/testing-library/angular-testing-library/commits?author=tonivj5" title="Code">💻</a></td>
190
192
</tr >
191
193
</table >
192
194
195
+ <!-- markdownlint-enable -->
196
+ <!-- prettier-ignore-end -->
197
+
193
198
<!-- ALL-CONTRIBUTORS-LIST:END -->
194
199
195
200
This project follows the [ all-contributors] [ all-contributors ] specification.
0 commit comments