@@ -112,9 +112,37 @@ describe('Transition', () => {
112
112
await nextFrame ( )
113
113
expect ( target . className . split ( ' ' ) ) . to . have . members ( [ 'foo' , 'transition-opacity' , 'ease-in-out' , 'duration-100' , 'opacity-0' ] )
114
114
115
- await aTimeout ( 100 )
115
+ await aTimeout ( 0 )
116
116
expect ( target . className . split ( ' ' ) ) . to . have . members ( [ 'foo' , 'opacity-0' , 'hidden' ] )
117
117
} )
118
+
119
+ it ( 'parses transitionOptions properly' , async ( ) => {
120
+ await fixture ( html `
121
+ < div id ="my-div " class ="opacity-100 ">
122
+ This popover shows on hover
123
+ </ div >
124
+ ` )
125
+
126
+ const target = document . getElementById ( 'my-div' )
127
+
128
+ leave ( target , {
129
+ leave : 'transition-opacity ease-in-out duration-100' ,
130
+ leaveFrom : 'opacity-100' ,
131
+ leaveTo : 'opacity-0' ,
132
+ toggleClass : 'my-hidden'
133
+ } )
134
+
135
+ expect ( target . className . split ( ' ' ) ) . to . have . members ( [ 'opacity-100' ] )
136
+
137
+ await nextFrame ( )
138
+ expect ( target . className . split ( ' ' ) ) . to . have . members ( [ 'transition-opacity' , 'ease-in-out' , 'duration-100' , 'opacity-100' ] )
139
+
140
+ await nextFrame ( )
141
+ expect ( target . className . split ( ' ' ) ) . to . have . members ( [ 'opacity-0' , 'transition-opacity' , 'ease-in-out' , 'duration-100' ] )
142
+
143
+ await aTimeout ( 0 )
144
+ expect ( target . className . split ( ' ' ) ) . to . have . members ( [ 'my-hidden' , 'opacity-0' ] )
145
+ } )
118
146
} )
119
147
120
148
describe ( 'enter()' , ( ) => {
@@ -131,9 +159,37 @@ describe('Transition', () => {
131
159
await nextFrame ( )
132
160
expect ( target . className . split ( ' ' ) ) . to . have . members ( [ 'foo' , 'transition-opacity' , 'ease-in-out' , 'duration-100' , 'opacity-100' ] )
133
161
134
- await aTimeout ( 100 )
162
+ await aTimeout ( 0 )
135
163
expect ( target . className . split ( ' ' ) ) . to . have . members ( [ 'foo' , 'opacity-100' ] )
136
164
} )
165
+
166
+ it ( 'parses transitionOptions properly' , async ( ) => {
167
+ await fixture ( html `
168
+ < div id ="my-div " class ="my-hidden ">
169
+ This popover shows on hover
170
+ </ div >
171
+ ` )
172
+
173
+ const target = document . getElementById ( 'my-div' )
174
+
175
+ enter ( target , {
176
+ enter : 'transition-opacity ease-in-out duration-100' ,
177
+ enterFrom : 'opacity-0' ,
178
+ enterTo : 'opacity-100' ,
179
+ toggle : 'my-hidden'
180
+ } )
181
+
182
+ expect ( target . className . split ( ' ' ) ) . to . have . members ( [ 'my-hidden' ] )
183
+
184
+ await nextFrame ( )
185
+ expect ( target . className . split ( ' ' ) ) . to . have . members ( [ 'opacity-0' , 'transition-opacity' , 'ease-in-out' , 'duration-100' ] )
186
+
187
+ await nextFrame ( )
188
+ expect ( target . className . split ( ' ' ) ) . to . have . members ( [ 'transition-opacity' , 'ease-in-out' , 'duration-100' , 'opacity-100' ] )
189
+
190
+ await aTimeout ( 0 )
191
+ expect ( target . className . split ( ' ' ) ) . to . have . members ( [ 'opacity-100' ] )
192
+ } )
137
193
} )
138
194
139
195
describe ( 'cancelTransition()' , ( ) => {
0 commit comments