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

Test coverage of responsive <picture> scenarii #93

Open
0gust1 opened this issue Mar 18, 2018 · 7 comments
Open

Test coverage of responsive <picture> scenarii #93

0gust1 opened this issue Mar 18, 2018 · 7 comments

Comments

@0gust1
Copy link

0gust1 commented Mar 18, 2018

Attempting to make a PR to solve #92, I tried to implement a set of tests for responsive images using <picture>tags.

It's not that easy, because js-dom(used for tests) doesn't replicate the browser behavior of triggering a src attribute set in the <img>tag injected by lozad, according to media queries defined on <source>elements.

I tried using mq-polyfill and canvas or canvas-prebuilt, with no luck so-far.

  • Do you see a way to do that correctly with js-dom ?
  • If not, should we / can we use a more heavy approach ? (using an automated headless browser, like pupetteer) ?

What do you think ?

@ApoorvSaxena
Copy link
Owner

@0gust1 using headless browser for testing of Lozad.js is the right way to move forward

@rgfx
Copy link

rgfx commented Mar 23, 2018

@0gust1 if you can get it working correctly with <picture> you will be my hero :)

@ApoorvSaxena
Copy link
Owner

@0gust1 any updates on the test case implementation?

@0gust1
Copy link
Author

0gust1 commented Apr 20, 2018

@ApoorvSaxena Hi ! I have locally a "working" prototype with jest and pupeteer. Sorry, didn't had much time (lot of churn at work+family).

Would you accept to remove the pre-commit hook on eslint (and let it for the build, of course) ?
It will enable people to push quickly an "imperfect/incomplete" code on a feature branch and working together on it.

@0gust1
Copy link
Author

0gust1 commented Apr 20, 2018

Also, the choice of puppeteer is questionable, with it, you can't test issues like this one : #99

@thiamsantos
Copy link
Contributor

@0gust1 with you want to push "imperfect/incomplete" code just add an -n flag to your commit. Something like: git commit -m "something good but incomplete" -n. By doing that the git hook is skipped.

@0gust1
Copy link
Author

0gust1 commented Apr 23, 2018

@thiamsantos thanks, I forgotten that :)

@ApoorvSaxena here we go : #101
I think, I'll update the PR in next days / next week (I'm on holidays abroad, should have access to net).

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