ember-cloaking icon indicating copy to clipboard operation
ember-cloaking copied to clipboard

Cloaking in integration tests

Open seanpdoyle opened this issue 11 years ago • 1 comments

Is there something special I should be doing in integration tests?

When I asset the presence of an element in the cloaked collection, it is never present.

It only displays the default Loading... text.

How do I force cloaked elements to be displayed? Does CSS come into account? Does a cloaked element in a headless browser (whatever is running ember-cli/testem tests -- phantomjs?) always remain cloaked?

seanpdoyle avatar Oct 03 '14 21:10 seanpdoyle

@seanpdoyle I managed to get integration tests working by ensuring my test container was the same height as the body. I think the reason it displays the default loading text is the calculations for determining if the element should be cloaked or not determine that the element in the test is out of the viewport through some assumptions that may be true in development/production but aren't true during the test.

Checkout: https://github.com/eviltrout/ember-cloaking/blob/f0d9f7345c98eea2c58de67584af4a3dc95aec92/ember-cloaking.js#L149-L166

MattMSumner avatar Dec 15 '14 16:12 MattMSumner