File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed
packages/core/test/acceptance Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -98,3 +98,54 @@ describe('attribute binding', () => {
98
98
expect ( a . href . indexOf ( 'unsafe:' ) ) . toBe ( - 1 ) ;
99
99
} ) ;
100
100
} ) ;
101
+
102
+ describe ( 'attribute interpolation' , ( ) => {
103
+ it ( 'should handle all varieties of interpolation' , ( ) => {
104
+ @Component ( {
105
+ template : `
106
+ <div attr.title="a{{a}}b{{b}}c{{c}}d{{d}}e{{e}}f{{f}}g{{g}}h{{h}}i{{i}}j"></div>
107
+ <div attr.title="a{{a}}b{{b}}c{{c}}d{{d}}e{{e}}f{{f}}g{{g}}h{{h}}i"></div>
108
+ <div attr.title="a{{a}}b{{b}}c{{c}}d{{d}}e{{e}}f{{f}}g{{g}}h"></div>
109
+ <div attr.title="a{{a}}b{{b}}c{{c}}d{{d}}e{{e}}f{{f}}g"></div>
110
+ <div attr.title="a{{a}}b{{b}}c{{c}}d{{d}}e{{e}}f"></div>
111
+ <div attr.title="a{{a}}b{{b}}c{{c}}d{{d}}e"></div>
112
+ <div attr.title="a{{a}}b{{b}}c{{c}}d"></div>
113
+ <div attr.title="a{{a}}b{{b}}c"></div>
114
+ <div attr.title="a{{a}}b"></div>
115
+ <div attr.title="{{a}}"></div>
116
+ `
117
+ } )
118
+ class App {
119
+ a = 1 ;
120
+ b = 2 ;
121
+ c = 3 ;
122
+ d = 4 ;
123
+ e = 5 ;
124
+ f = 6 ;
125
+ g = 7 ;
126
+ h = 8 ;
127
+ i = 9 ;
128
+ }
129
+
130
+ TestBed . configureTestingModule ( {
131
+ declarations : [ App ] ,
132
+ } ) ;
133
+ const fixture = TestBed . createComponent ( App ) ;
134
+ fixture . detectChanges ( ) ;
135
+
136
+ const divs = fixture . debugElement . queryAll ( By . css ( 'div[title]' ) ) ;
137
+
138
+ expect ( divs . map ( el => el . nativeElement . getAttribute ( 'title' ) ) ) . toEqual ( [
139
+ 'a1b2c3d4e5f6g7h8i9j' ,
140
+ 'a1b2c3d4e5f6g7h8i' ,
141
+ 'a1b2c3d4e5f6g7h' ,
142
+ 'a1b2c3d4e5f6g' ,
143
+ 'a1b2c3d4e5f' ,
144
+ 'a1b2c3d4e' ,
145
+ 'a1b2c3d' ,
146
+ 'a1b2c' ,
147
+ 'a1b' ,
148
+ '1' ,
149
+ ] ) ;
150
+ } ) ;
151
+ } ) ;
You can’t perform that action at this time.
0 commit comments