@@ -134,4 +134,55 @@ suite('CSSTransformValue', function() {
134134 assert . isNull ( consumeTransformValue ( 'bananas' ) ) ;
135135 assert . isNull ( consumeTransformValue ( '5px' ) ) ;
136136 } ) ;
137+
138+ test ( 'Using spread operator on CSSTransformValue results in correct values' , function ( ) {
139+ var inputComponents = [ new CSSScale ( 2 , 4 ) ] ;
140+ var expectedEntries = [ [ 0 , inputComponents [ 0 ] ] ] ;
141+ var transform = new CSSTransformValue ( inputComponents ) ;
142+ assert . deepEqual ( [ ...transform ] , expectedEntries ) ;
143+ } ) ;
144+
145+ test ( 'Using iterator operations on entries() gets correct values' , function ( ) {
146+ var inputComponents = [ new CSSScale ( 2 , 4 ) ] ;
147+ var expectedEntries = [ [ 0 , inputComponents [ 0 ] ] ] ;
148+ var transform = new CSSTransformValue ( inputComponents ) ;
149+
150+ // One by one
151+ assert . deepEqual (
152+ iteratorExpansionUsingNext ( transform . entries ( ) ) , expectedEntries ) ;
153+ // for..of
154+ assert . deepEqual (
155+ iteratorExpansionUsingForOf ( transform . entries ( ) ) , expectedEntries ) ;
156+ // Spread operator
157+ assert . deepEqual ( [ ...transform . entries ( ) ] , expectedEntries ) ;
158+ } ) ;
159+
160+ test ( 'Using iterator operations on keys() gets correct values' , function ( ) {
161+ var inputComponents = [ new CSSScale ( 2 , 4 ) ] ;
162+ var expectedKeys = [ 0 ] ;
163+ var transform = new CSSTransformValue ( inputComponents ) ;
164+
165+ // One by one
166+ assert . deepEqual (
167+ iteratorExpansionUsingNext ( transform . keys ( ) ) , expectedKeys ) ;
168+ // for..of
169+ assert . deepEqual (
170+ iteratorExpansionUsingForOf ( transform . keys ( ) ) , expectedKeys ) ;
171+ // Spread operator
172+ assert . deepEqual ( [ ...transform . keys ( ) ] , expectedKeys ) ;
173+ } ) ;
174+
175+ test ( 'Using iterator operations on values() gets correct values' , function ( ) {
176+ var inputComponents = [ new CSSScale ( 2 , 4 ) ] ;
177+ var transform = new CSSTransformValue ( inputComponents ) ;
178+
179+ // One by one
180+ assert . deepEqual (
181+ iteratorExpansionUsingNext ( transform . values ( ) ) , inputComponents ) ;
182+ // for..of
183+ assert . deepEqual (
184+ iteratorExpansionUsingForOf ( transform . values ( ) ) , inputComponents ) ;
185+ // Spread operator
186+ assert . deepEqual ( [ ...transform . values ( ) ] , inputComponents ) ;
187+ } ) ;
137188} ) ;
0 commit comments