@@ -40,7 +40,7 @@ describe('vaadin-icon - icon fonts', () => {
4040 let icon ;
4141
4242 beforeEach ( async ( ) => {
43- icon = fixtureSync ( '<vaadin-icon font ="my-icon-font icon-before"></vaadin-icon>' ) ;
43+ icon = fixtureSync ( '<vaadin-icon icon-class ="my-icon-font icon-before"></vaadin-icon>' ) ;
4444 await onceResized ( icon ) ;
4545 } ) ;
4646
@@ -81,79 +81,79 @@ describe('vaadin-icon - icon fonts', () => {
8181 } ) ;
8282 } ) ;
8383
84- describe ( 'font ' , ( ) => {
84+ describe ( 'iconClass ' , ( ) => {
8585 let icon ;
8686
87- it ( 'should add the font to element class list' , ( ) => {
88- icon = fixtureSync ( '<vaadin-icon font ="my-icon-font icon-before"></vaadin-icon>' ) ;
87+ it ( 'should add the icon class to element class list' , ( ) => {
88+ icon = fixtureSync ( '<vaadin-icon icon-class ="my-icon-font icon-before"></vaadin-icon>' ) ;
8989 expect ( icon . classList . contains ( 'my-icon-font' ) ) . to . be . true ;
9090 expect ( icon . classList . contains ( 'icon-before' ) ) . to . be . true ;
9191 } ) ;
9292
9393 it ( 'should not overwrite existing classes' , ( ) => {
9494 icon = fixtureSync ( '<vaadin-icon class="foo"></vaadin-icon>' ) ;
95- icon . font = 'my-icon-font icon-before' ;
95+ icon . iconClass = 'my-icon-font icon-before' ;
9696 expect ( icon . classList . contains ( 'foo' ) ) . to . be . true ;
9797 } ) ;
9898
99- it ( 'should change font classes' , ( ) => {
100- icon = fixtureSync ( '<vaadin-icon class="foo" font ="my-icon-font icon-before"></vaadin-icon>' ) ;
101- icon . font = 'my-icon-font icon-after' ;
99+ it ( 'should change icon classes' , ( ) => {
100+ icon = fixtureSync ( '<vaadin-icon class="foo" icon-class ="my-icon-font icon-before"></vaadin-icon>' ) ;
101+ icon . iconClass = 'my-icon-font icon-after' ;
102102 expect ( icon . classList . contains ( 'icon-before' ) ) . to . be . false ;
103103 expect ( icon . classList . contains ( 'icon-after' ) ) . to . be . true ;
104104 } ) ;
105105
106- it ( 'should remove all font classes' , ( ) => {
107- icon = fixtureSync ( '<vaadin-icon class="foo" font ="my-icon-font icon-before"></vaadin-icon>' ) ;
108- icon . font = '' ;
106+ it ( 'should remove all icon classes' , ( ) => {
107+ icon = fixtureSync ( '<vaadin-icon class="foo" icon-class ="my-icon-font icon-before"></vaadin-icon>' ) ;
108+ icon . iconClass = '' ;
109109 expect ( icon . classList . contains ( 'my-icon-font' ) ) . to . be . false ;
110110 expect ( icon . classList . contains ( 'icon-before' ) ) . to . be . false ;
111111 expect ( icon . classList . contains ( 'foo' ) ) . to . be . true ;
112112 } ) ;
113113
114- it ( 'should restore the font to element class list' , ( ) => {
115- icon = fixtureSync ( '<vaadin-icon font ="my-icon-font icon-before"></vaadin-icon>' ) ;
114+ it ( 'should restore the icon class to element class list' , ( ) => {
115+ icon = fixtureSync ( '<vaadin-icon icon-class ="my-icon-font icon-before"></vaadin-icon>' ) ;
116116 icon . className = 'foo' ;
117117 expect ( icon . classList . contains ( 'my-icon-font' ) ) . to . be . true ;
118118 expect ( icon . classList . contains ( 'icon-before' ) ) . to . be . true ;
119119 expect ( icon . classList . contains ( 'foo' ) ) . to . be . true ;
120120 } ) ;
121121
122- it ( 'should restore the missing font to element class list' , ( ) => {
123- icon = fixtureSync ( '<vaadin-icon font ="my-icon-font icon-before"></vaadin-icon>' ) ;
122+ it ( 'should restore the missing icon class to element class list' , ( ) => {
123+ icon = fixtureSync ( '<vaadin-icon icon-class ="my-icon-font icon-before"></vaadin-icon>' ) ;
124124 icon . className = 'my-icon-font' ;
125125 expect ( icon . classList . contains ( 'my-icon-font' ) ) . to . be . true ;
126126 expect ( icon . classList . contains ( 'icon-before' ) ) . to . be . true ;
127127 } ) ;
128128
129- it ( 'should restore the removed font to element class list' , ( ) => {
130- icon = fixtureSync ( '<vaadin-icon font ="my-icon-font icon-before"></vaadin-icon>' ) ;
129+ it ( 'should restore the removed icon class to element class list' , ( ) => {
130+ icon = fixtureSync ( '<vaadin-icon icon-class ="my-icon-font icon-before"></vaadin-icon>' ) ;
131131 icon . classList . remove ( 'my-icon-font' ) ;
132132 expect ( icon . classList . contains ( 'my-icon-font' ) ) . to . be . true ;
133133 expect ( icon . classList . contains ( 'icon-before' ) ) . to . be . true ;
134134 } ) ;
135135
136- it ( 'should reflect font as an attribute' , ( ) => {
136+ it ( 'should reflect icon class as an attribute' , ( ) => {
137137 icon = fixtureSync ( '<vaadin-icon></vaadin-icon>' ) ;
138- icon . font = 'my-icon-font icon-before' ;
139- expect ( icon . getAttribute ( 'font ' ) ) . to . equal ( 'my-icon-font icon-before' ) ;
138+ icon . iconClass = 'my-icon-font icon-before' ;
139+ expect ( icon . getAttribute ( 'icon-class ' ) ) . to . equal ( 'my-icon-font icon-before' ) ;
140140 } ) ;
141141
142- it ( 'should add icon attribute if font is set' , ( ) => {
142+ it ( 'should add icon attribute if icon class is set' , ( ) => {
143143 icon = fixtureSync ( '<vaadin-icon></vaadin-icon>' ) ;
144- icon . font = 'my-icon-font icon-before' ;
144+ icon . iconClass = 'my-icon-font icon-before' ;
145145 expect ( icon . hasAttribute ( 'icon' ) ) . to . be . true ;
146146 } ) ;
147147
148- it ( 'should not add icon attribute if font is not set' , ( ) => {
148+ it ( 'should not add icon attribute if icon class is not set' , ( ) => {
149149 icon = fixtureSync ( '<vaadin-icon></vaadin-icon>' ) ;
150- icon . font = null ;
150+ icon . iconClass = null ;
151151 expect ( icon . hasAttribute ( 'icon' ) ) . to . be . false ;
152152 } ) ;
153153
154154 it ( 'should not override existing icon' , ( ) => {
155155 icon = fixtureSync ( '<vaadin-icon icon="foo:bar"></vaadin-icon>' ) ;
156- icon . font = 'my-icon-font icon-before' ;
156+ icon . iconClass = 'my-icon-font icon-before' ;
157157 expect ( icon . icon ) . to . equal ( 'foo:bar' ) ;
158158 } ) ;
159159 } ) ;
@@ -162,19 +162,19 @@ describe('vaadin-icon - icon fonts', () => {
162162 let icon ;
163163
164164 it ( 'should reflect unprefixed char as font-icon-content attribute' , ( ) => {
165- icon = fixtureSync ( '<vaadin-icon font ="my-icon-font"></vaadin-icon>' ) ;
165+ icon = fixtureSync ( '<vaadin-icon icon-class ="my-icon-font"></vaadin-icon>' ) ;
166166 icon . char = 'e900' ;
167167 expect ( icon . getAttribute ( 'font-icon-content' ) ) . to . equal ( '\ue900' ) ;
168168 } ) ;
169169
170170 it ( 'should reflect prefixed char as font-icon-content attribute' , ( ) => {
171- icon = fixtureSync ( '<vaadin-icon font ="my-icon-font"></vaadin-icon>' ) ;
171+ icon = fixtureSync ( '<vaadin-icon icon-class ="my-icon-font"></vaadin-icon>' ) ;
172172 icon . char = '\ue900' ;
173173 expect ( icon . getAttribute ( 'font-icon-content' ) ) . to . equal ( '\ue900' ) ;
174174 } ) ;
175175
176176 it ( 'should remove font-icon-content attribute' , ( ) => {
177- icon = fixtureSync ( '<vaadin-icon font ="my-icon-font"></vaadin-icon>' ) ;
177+ icon = fixtureSync ( '<vaadin-icon icon-class ="my-icon-font"></vaadin-icon>' ) ;
178178 icon . char = 'e900' ;
179179 icon . char = null ;
180180 expect ( icon . hasAttribute ( 'font-icon-content' ) ) . to . be . false ;
@@ -206,13 +206,13 @@ describe('vaadin-icon - icon fonts', () => {
206206 let icon ;
207207
208208 it ( 'should reflect ligature as font-icon-content attribute' , ( ) => {
209- icon = fixtureSync ( '<vaadin-icon font ="my-icon-font"></vaadin-icon>' ) ;
209+ icon = fixtureSync ( '<vaadin-icon icon-class ="my-icon-font"></vaadin-icon>' ) ;
210210 icon . ligature = 'foo' ;
211211 expect ( icon . getAttribute ( 'font-icon-content' ) ) . to . equal ( 'foo' ) ;
212212 } ) ;
213213
214214 it ( 'should remove font-icon-content attribute' , ( ) => {
215- icon = fixtureSync ( '<vaadin-icon font ="my-icon-font"></vaadin-icon>' ) ;
215+ icon = fixtureSync ( '<vaadin-icon icon-class ="my-icon-font"></vaadin-icon>' ) ;
216216 icon . ligature = 'foo' ;
217217 icon . ligature = null ;
218218 expect ( icon . hasAttribute ( 'font-icon-content' ) ) . to . be . false ;
@@ -280,8 +280,8 @@ describe('vaadin-icon - icon fonts', () => {
280280 expect ( supportsCQUnitsForPseudoElements ( ) ) . to . be . false ;
281281 } ) ;
282282
283- fallBackIt ( 'should have the custom property (font )' , async ( ) => {
284- icon = fixtureSync ( '<vaadin-icon font ="foo"></vaadin-icon>' ) ;
283+ fallBackIt ( 'should have the custom property (iconClass )' , async ( ) => {
284+ icon = fixtureSync ( '<vaadin-icon icon-class ="foo"></vaadin-icon>' ) ;
285285 await nextFrame ( ) ;
286286 expect ( icon . style . getPropertyValue ( '--_vaadin-font-icon-size' ) ) . to . equal ( '24px' ) ;
287287 } ) ;
@@ -301,12 +301,12 @@ describe('vaadin-icon - icon fonts', () => {
301301 fallBackIt ( 'should set the custom property' , async ( ) => {
302302 icon = fixtureSync ( '<vaadin-icon></vaadin-icon>' ) ;
303303 await nextFrame ( ) ;
304- icon . font = 'foo' ;
304+ icon . iconClass = 'foo' ;
305305 expect ( icon . style . getPropertyValue ( '--_vaadin-font-icon-size' ) ) . to . equal ( '24px' ) ;
306306 } ) ;
307307
308308 fallBackIt ( 'should update the custom property' , async ( ) => {
309- icon = fixtureSync ( '<vaadin-icon font ="foo"></vaadin-icon>' ) ;
309+ icon = fixtureSync ( '<vaadin-icon icon-class ="foo"></vaadin-icon>' ) ;
310310 await nextFrame ( ) ;
311311 icon . style . width = '100px' ;
312312 icon . style . height = '100px' ;
0 commit comments