Page MenuHomeSoftware Heritage

Add tests for sidebar, back-to-top
ClosedPublic

Authored by kalpitk on Jun 13 2019, 9:50 AM.

Details

Summary

Add tests for webapp functionalities - sidebar, back-to-top

Related T1768

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kalpitk created this revision.Jun 13 2019, 9:50 AM
kalpitk edited the summary of this revision. (Show Details)Jun 13 2019, 9:50 AM
vlorentz requested changes to this revision.Jun 13 2019, 1:55 PM
vlorentz added a subscriber: vlorentz.

Nice! Could you also add a test checking the width of the collapsed sidebar is lower than of the open sidebar?

This revision now requires changes to proceed.Jun 13 2019, 1:55 PM
kalpitk updated this revision to Diff 5218.Jun 13 2019, 2:17 PM
  • refactor sidebar test
kalpitk updated this revision to Diff 5219.Jun 13 2019, 2:20 PM
  • refactor sidebar test

While working on the tests, I found that for non-lg devices (width<992), first time you press the push-menu, it doesn't toggle. Instead it adds 'sidebar-collapse' first time. I think there is some conflict between webapp-utils.js:5 and the bootstrap defaults. I couldn't find the exact cause to it.

kalpitk updated this revision to Diff 5230.Jun 13 2019, 6:36 PM
  • Test sidebar widths
vlorentz accepted this revision.Jun 14 2019, 2:14 PM
This revision is now accepted and ready to land.Jun 14 2019, 2:14 PM
vlorentz requested changes to this revision.Jun 14 2019, 2:15 PM

Could you rename the file to cypress/integration/sidebar.spec.js?

This revision now requires changes to proceed.Jun 14 2019, 2:15 PM

Could you rename the file to cypress/integration/sidebar.spec.js?

In that case should I move back-to-top tests to another file or keep it in the same sidebar.spec.js ?

anlambert requested changes to this revision.Mon, Jun 17, 11:00 AM
anlambert added a subscriber: anlambert.

Nice! I agree with @vlorentz , you should split the tests into two spec files: sidebar.spec.js and back-to-top.spec.js. Once it is done, that diff can be landed.

kalpitk updated this revision to Diff 5276.Mon, Jun 17, 12:32 PM
  • Split tests into two files
  • Rebase with master
vlorentz accepted this revision.Mon, Jun 17, 3:14 PM
anlambert accepted this revision.Mon, Jun 17, 5:41 PM
This revision is now accepted and ready to land.Mon, Jun 17, 5:41 PM
kalpitk added a comment.EditedMon, Jun 17, 6:09 PM

Sidebar tests fail.

This is because, the cypress view is interpreted as sm by JS.
Cypress viewport is 1000px(width) by 660px(height). Apparently the window width is a bit smaller than the viewport. (around 985px)

I am updating the cypress config file (1920*1080) to ensure we are testing for lg devices by default.

kalpitk updated this revision to Diff 5286.Mon, Jun 17, 6:27 PM

Fix failing tests

Please review the change

@kalpitk , looks good ! You can land it.

This revision was automatically updated to reflect the committed changes.