Closed sagarpreet-chadha closed 5 years ago
Hi @jywarren !
dist/Leaflet.BlurredLocationDisplay.js
is not being loaded before the tests are loaded . Can you help in setting up the testing environment ? Thanks !
Hi @jywarren , Kindly take a look at it once 😄 !
Yes tried that as well ! Added LBL , LBLD dependencies in vendor , still showing the same error . LBLD is not getting loaded before the specs starts running .
Hmm, confusing. Maybe you have to include the source files like this?
https://github.com/publiclab/PublicLab.Editor/blob/master/Gruntfile.js#L44-L46
If this doesn't work, maybe ping @rexagod
or someone else from image-sequencer
as they are really good with test setup!
Hey @rexagod , @tech4GT , @publiclab/reviewers ! Can someone with good testing background help me solve this one ? Looking forward to hear from you guys :smile: . Thank you :)
Noticing that Travis and local both give different errors (BlurredLocation
and BlurredLocationDisplay
respectively). @sagarpreet-chadha Are you getting an asynchronous
warning in your logs as well?
Working on this.
Hello, @sagarpreet-chadha! I've made some comments above, depending on some checks I made below.
PS. All the tests are passing if length is expected to be 0, meaning that for some reason the DOMchildren
aren't being loaded.
Getting contradicting results.
Made some changes along the way.
if(map && map.getZoom() >= 3 && map.getZoom() <=9)
, since getZoom wasn't initialized onDOMload
so we might want to look into that as well.if(typeof options.blurredLocation.getRectangle !== "undefined")
, removed parenthesis from above, since getRectangle
itself wasn't on blurredLocation
's chain.Hi @rexagod ...thank you for the recommendations 😄 . What do you think could be the possible reason that LBL and LBLD libraries are not getting loaded before testing starts ? Thanks !
Thank you @arpansac , the fixtures are now being loaded 🎉 . 2 out of 5 tests are running now 👍 .
Also now all libraries are also getting loaded except LBLD .
Now we just have to figure why LBLD is not getting loaded . Thanks all 😄 !
We use Jasmine jquery to load fixtures , but this package is not maintained . Also see this which i found in its documentation (this should solve the error which one gets when grunt jasmine
is run on localhost) :
Source : https://github.com/velesin/jasmine-jquery
And this error on Travis 😄 asks to open issue in puppeteer package :
grunt-contrib-Jasmine runs on phantomJS , and phantomJS does not support ES6 !
YAYYY 🎉
I think i will write a blog about it :P . So some ES6 functions were causing problem because phantomJS does not support ES6 ! And regarding LBLD not loading in fixtures --- it is yet an unsolved issue in Jasmine-jquery !
@jywarren ...kindly review 😄 !
Should we add put this library to npm ?
@jywarren ...kindly review this one as well 😄 !
OK! Sorry i had replied via email but it didn't go through!
Awesome! Thanks Sagarpreet and great problem solving, this was such a tough one. I'm sorry i wasn't able to help more! Perhaps a good deal of this testing workflow is starting to age a bit. But you got it! 🙌
Fixes #45 !