File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ export class ElementAssertion<T extends Element> extends Assertion<T> {
217217 }
218218
219219 /**
220- * Asserts that the element has one or more of the specified CSS style .
220+ * Asserts that the element has one or more of the specified CSS styles .
221221 *
222222 * @example
223223 * ```
@@ -230,15 +230,16 @@ export class ElementAssertion<T extends Element> extends Assertion<T> {
230230
231231 public toHaveSomeStyle ( expected : Partial < CSSStyleDeclaration > ) : this {
232232
233- const [ expectedStyle , receivedStyle ] = getExpectedAndReceivedStyles ( this . actual , expected ) ;
233+ const [ expectedStyle , elementProcessedStyle ] = getExpectedAndReceivedStyles ( this . actual , expected ) ;
234234
235- if ( ! expectedStyle || ! receivedStyle ) {
235+ if ( ! expectedStyle || ! elementProcessedStyle ) {
236236 throw new Error ( "No available styles." ) ;
237237 }
238238
239- const hasSomeStyle = Object . values ( receivedStyle ) . some ( ( receivedItem , idx ) => {
240- const expectedItem = Object . values ( expectedStyle ) [ idx ] ;
241- return equal ( expectedItem , receivedItem ) ;
239+ const hasSomeStyle = Object . entries ( expectedStyle ) . some ( ( [ expectedProp , expectedValue ] ) => {
240+ return Object . entries ( elementProcessedStyle ) . some ( ( [ receivedProp , receivedValue ] ) => {
241+ return equal ( expectedProp , receivedProp ) && equal ( expectedValue , receivedValue ) ;
242+ } ) ;
242243 } ) ;
243244
244245 const error = new AssertionError ( {
You can’t perform that action at this time.
0 commit comments