You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test('button can toggle color',function(assert){awaitrender(hbs`<ToggleColorButton class=".btn" @on="#00FF00" />`);// toggle on the buttonawaitclick('.btn');// button has `on` colorassert.dom('btn').hasStyle({backgroundColor: '#00FF00'});// toggle the button off againawaitclick('.btn');// `on` color has been removedassert.dom('btn').hasStyle({});});
The last LOC incorrectly assumes, that hasStyle({}) asserts that all "custom" styles have been removed. In reality hasStyle({}) does not assert anything:
I would suggest to throw an error or fail the assertion, when an empty object is passed to hasStyle, as this can never be a valid assertion and is most likely a mistake of the author of the test.
The text was updated successfully, but these errors were encountered:
I've encountered usages like this in the wild:
The last LOC incorrectly assumes, that
hasStyle({})
asserts that all "custom" styles have been removed. In realityhasStyle({})
does not assert anything:https://github.com/simplabs/qunit-dom/blob/2a73e56344829a6f1fd3b28cd5df6b4ee1d00b75/lib/assertions.ts#L583-L586
I would suggest to throw an error or fail the assertion, when an empty object is passed to
hasStyle
, as this can never be a valid assertion and is most likely a mistake of the author of the test.The text was updated successfully, but these errors were encountered: