@@ -117,20 +117,20 @@ export class CounterComponent {
117117counter.component.spec.ts
118118
119119``` typescript
120- import { render } from ' @testing-library/angular' ;
120+ import { render , screen } from ' @testing-library/angular' ;
121121import CounterComponent from ' ./counter.component.ts' ;
122122
123123describe (' Counter' , () => {
124124 test (' should render counter' , async () => {
125- const { getByText } = await render (CounterComponent , { componentProperties: { counter: 5 } });
125+ await render (CounterComponent , { componentProperties: { counter: 5 } });
126126
127- expect (getByText (' Current Count: 5' ));
127+ expect (screen . getByText (' Current Count: 5' ));
128128 });
129129
130130 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 } });
132132
133- click (getByText (' +' ));
133+ click (screen . getByText (' +' ));
134134
135135 expect (getByText (' Current Count: 6' ));
136136 });
@@ -194,6 +194,7 @@ Thanks goes to these people ([emoji key][emojis]):
194194
195195<!-- markdownlint-enable -->
196196<!-- prettier-ignore-end -->
197+
197198<!-- ALL-CONTRIBUTORS-LIST:END -->
198199
199200This project follows the [ all-contributors] [ all-contributors ] specification.
0 commit comments