Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question on testing #50

Closed
jrdn91 opened this issue Nov 13, 2015 · 3 comments
Closed

Question on testing #50

jrdn91 opened this issue Nov 13, 2015 · 3 comments

Comments

@jrdn91
Copy link

jrdn91 commented Nov 13, 2015

Will this addon help me write tests to test responsive conditions being met?

I have an app I'm developing that we want people to run on their devices, so on the desktop using media queries it will show a message in place of the app to tell the user to open on their device. This works but I wanted to make a test for it to save my behind if I accidentally remove the class of override it somewhere.

Is there a way possibly with this addon that I can spoof a certain media query to then check if the proper message is being shown? And vise versa for the app to be shown on certain media queries?

@mitchlloyd
Copy link

Hypothetically you should be able to stub the media service in your tests to respond to your media queries. The ergonomics of this have changed over time and the last thing that worked for me was this:

this.application.__deprecatedInstance__.register('service:foo', Ember.Service.extend());

I know that Robert Jackson has been working on the various testing libraries and registry implementations to improve this, so there might already be a better way.

@bantic
Copy link
Contributor

bantic commented Mar 4, 2016

The Grand Testing Unification ember RFC has some good context on what works today and what the coming changes are, for mocking a service like ember-responsive in ember tests.

@k-fish
Copy link
Contributor

k-fish commented Sep 29, 2016

There are now test helpers which spoof breakpoints. See linked PR.

@k-fish k-fish closed this as completed Sep 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants