collective / collective.lazysizes

Integration of lazysizes, a lightweight lazy loader, into Plone.
https://pypi.org/project/collective.lazysizes
6 stars 2 forks source link

Refactor resource registries test to run under Plone 5 also #10

Closed hvelarde closed 8 years ago

hvelarde commented 8 years ago

@ebrehault I'm trying your approach on checking static resources but for some unknown reason it's not working; resources appear to be in production mode instead of development, even as I declared explicitly that on the tests.

what I'm doing wrong?

ebrehault commented 8 years ago

@hvelarde I might be wrong, but I have the feeling you are using the hvelarde-resources branch so your bundle is not declared https://github.com/collective/collective.lazysizes/blob/hvelarde-resources/src/collective/lazysizes/profiles/default/registry.xml

It should work if you run this test on the hvelarde-plone5 branch.

hvelarde commented 8 years ago

@ebrehault the point is the test is failing in Plone 4.3 also.

ebrehault commented 8 years ago

@hvelarde it took me some time, but I found a way to force the JS dev mode in the tests. We have to add:

self.portal.portal_javascripts.setDebugMode(True)

in setUp.

At least, it fixes your test on Plone 4, I haven't tried on Plone 5 (I guess I have network issues, by the way I have also pushed the fix I just mentionned on your branch, but it seems like it is not properly retrieved on GitHub...)

hvelarde commented 8 years ago

@ebrehault that's pretty weird because I have the exact same code in another add-on and it's working there.

I think your change wont work in Plone 5.

ebrehault commented 8 years ago

We do have the same code in example.p4p5, and it works too. I spend a lot of time trying to understand what is different in lazysizes, and I have found anything. If you find the explanation, please tell me :)

On Wed, Apr 6, 2016 at 6:34 AM, Héctor Velarde notifications@github.com wrote:

@ebrehault https://github.com/ebrehault that's pretty weird because I have the exact same code https://github.com/simplesconsultoria/collective.texttospeech/blob/master/src/collective/texttospeech/tests/test_resources.py in another add-on and it's working there.

I think your change wont work in Plone 5.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/collective/collective.lazysizes/pull/10#issuecomment-206114786

hvelarde commented 8 years ago

@vangheem can you point us in the right direction here? how do I verify if some JS or CSS resource is present in Plone 5; I'm trying development mode but my JS file is inside some RequireJS file.

how do I test that programmatically?

also, I noticed that even as those resources are there, the JS code is not being executed and I have not a single message on the JS console for debugging; any hints?

hvelarde commented 8 years ago

I opened https://github.com/plone/Products.CMFPlone/issues/1511 for the later.

hvelarde commented 8 years ago

@ebrehault I think I can mark the package now as Plone 5 compatible; thank you!

@vangheem I still need your help to fix the last test failing.