Plugin stylesheets are not included in qunit tests

I noticed today, while building qunit tests for a plugin, that the stylesheet(s) for the plugin are not available to the qunit testing suite.

It was a long and winding road to figure out that the reason my tests weren’t passing was because they depended on certain styles being applied to the UI elements.

In particular, I was applying an active class to one item out of a set in an ember {{#each}} block. All non-active list items were hidden and only the “active” item was visible.

I’ll admit that might be a bad practice, as it’s adding more to the HTML/component tree than necessary. And I refactored it so that ember only renders the single active item instead of looping through the list.

Anyways, I’m mostly making this post to document that qunit tests (at least for plugins) should not be dependent on any styles defined by the plugin.

2 Likes