1
1
import { Component , input , output , inputBinding , outputBinding , twoWayBinding , signal , model } from '@angular/core' ;
2
2
import { render , screen , aliasedInput } from '../src/public_api' ;
3
3
4
- describe ( 'ATL Bindings API Support' , ( ) => {
4
+ describe ( 'Bindings API Support' , ( ) => {
5
5
@Component ( {
6
6
selector : 'atl-bindings-test' ,
7
7
template : `
@@ -34,7 +34,7 @@ describe('ATL Bindings API Support', () => {
34
34
}
35
35
}
36
36
37
- it ( 'should support inputBinding for regular inputs' , async ( ) => {
37
+ it ( 'supports inputBinding for regular inputs' , async ( ) => {
38
38
await render ( BindingsTestComponent , {
39
39
bindings : [ inputBinding ( 'value' , ( ) => 'test-value' ) , inputBinding ( 'greet' , ( ) => 'hi there' ) ] ,
40
40
} ) ;
@@ -43,7 +43,7 @@ describe('ATL Bindings API Support', () => {
43
43
expect ( screen . getByTestId ( 'greeting' ) ) . toHaveTextContent ( 'hi there' ) ;
44
44
} ) ;
45
45
46
- it ( 'should support outputBinding for outputs' , async ( ) => {
46
+ it ( 'supports outputBinding for outputs' , async ( ) => {
47
47
const clickHandler = jest . fn ( ) ;
48
48
49
49
await render ( BindingsTestComponent , {
@@ -56,7 +56,7 @@ describe('ATL Bindings API Support', () => {
56
56
expect ( clickHandler ) . toHaveBeenCalledWith ( 'clicked: bound-value' ) ;
57
57
} ) ;
58
58
59
- it ( 'should support inputBinding with writable signal for re-rendering scenario' , async ( ) => {
59
+ it ( 'supports inputBinding with writable signal for re-rendering scenario' , async ( ) => {
60
60
const valueSignal = signal ( 'initial-value' ) ;
61
61
62
62
await render ( BindingsTestComponent , {
@@ -73,7 +73,7 @@ describe('ATL Bindings API Support', () => {
73
73
expect ( await screen . findByText ( 'updated-value' ) ) . toBeInTheDocument ( ) ;
74
74
} ) ;
75
75
76
- it ( 'should support twoWayBinding for model signals' , async ( ) => {
76
+ it ( 'supports twoWayBinding for model signals' , async ( ) => {
77
77
const nameSignal = signal ( 'initial name' ) ;
78
78
79
79
await render ( TwoWayBindingTestComponent , {
@@ -99,7 +99,7 @@ describe('ATL Bindings API Support', () => {
99
99
expect ( nameSignal ( ) ) . toBe ( 'updated from component' ) ;
100
100
} ) ;
101
101
102
- it ( 'should warn when mixing bindings with traditional inputs but still work ' , async ( ) => {
102
+ it ( 'warns when mixing bindings with traditional inputs but still works ' , async ( ) => {
103
103
const consoleSpy = jest . spyOn ( console , 'warn' ) . mockImplementation ( ) ;
104
104
const clickHandler = jest . fn ( ) ;
105
105
const bindingClickHandler = jest . fn ( ) ;
@@ -121,19 +121,18 @@ describe('ATL Bindings API Support', () => {
121
121
const button = screen . getByTestId ( 'emit-button' ) ;
122
122
button . click ( ) ;
123
123
124
- // Both binding and traditional handlers should be called for outputs
124
+ // Both binding and traditional handlers are called for outputs
125
125
expect ( bindingClickHandler ) . toHaveBeenCalledWith ( 'clicked: binding-value' ) ;
126
126
expect ( clickHandler ) . toHaveBeenCalledWith ( 'clicked: binding-value' ) ;
127
127
128
- // Should show warning about mixed usage for inputs
128
+ // Shows warning about mixed usage for inputs
129
129
expect ( consoleSpy ) . toHaveBeenCalledWith (
130
- 'ATL: You specified both bindings and traditional inputs. ' +
131
- 'Angular does not allow mixing setInput() with inputBinding(). ' +
130
+ '[@testing-library/angular]: You specified both bindings and traditional inputs. ' +
132
131
'Only bindings will be used for inputs. Use bindings for all inputs to avoid this warning.' ,
133
132
) ;
134
133
135
134
expect ( consoleSpy ) . toHaveBeenCalledWith (
136
- 'ATL : You specified both bindings and traditional output listeners. ' +
135
+ '[@testing-library/angular] : You specified both bindings and traditional output listeners. ' +
137
136
'Consider using outputBinding() for all outputs for consistency.' ,
138
137
) ;
139
138
0 commit comments