File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ counter.component.ts
98
98
99
99
``` ts
100
100
@Component ({
101
- selector: ' counter' ,
101
+ selector: ' app- counter' ,
102
102
template: `
103
103
<button (click)="decrement()">-</button>
104
104
<span>Current Count: {{ counter }}</span>
@@ -122,7 +122,7 @@ counter.component.spec.ts
122
122
123
123
``` typescript
124
124
import { render , screen , fireEvent } from ' @testing-library/angular' ;
125
- import { CounterComponent } from ' ./counter.component.ts ' ;
125
+ import { CounterComponent } from ' ./counter.component' ;
126
126
127
127
describe (' Counter' , () => {
128
128
test (' should render counter' , async () => {
@@ -134,7 +134,7 @@ describe('Counter', () => {
134
134
test (' should increment the counter on click' , async () => {
135
135
await render (CounterComponent , { componentProperties: { counter: 5 } });
136
136
137
- const incrementButton = screen .getByRole (' button' , { name: / increment / i });
137
+ const incrementButton = screen .getByRole (' button' , { name: ' + ' });
138
138
fireEvent .click (incrementButton );
139
139
140
140
expect (screen .getByText (' Current Count: 6' ));
You can’t perform that action at this time.
0 commit comments