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

Improve testability + small code changes of AppSideBarTabs #1515

Merged
merged 9 commits into from
Nov 19, 2020

Conversation

LiquidITGuy
Copy link

Hi,

I added unit tests on already tested component to familiarize myself with the code.
I also fix some warning on the passing tests of the current code (stub of console does not work as expected)

During this phase I found a bug with the key listener.
According to the documentation, we can use the kebab-case standard even if it’s not a defined shortcut.
https://vuejs.org/v2/guide/events.html#Key-Modifiers
But it doesn’t seem to work on every system.
Other events seems to trigger the listeners ‘keydown.page-up’ and ‘page down’.
You can try it with the written tests.
According to Vue-test-utils the key to trigger it in tests are ‘pageup’ and ‘pagedown’.
https://vue-test-utils.vuejs.org/guides/dom-events.html

May it be an issue in Vuejs listener process on some engines?
For now I fixed it with the keyboard code.
After writing those tests, I make some minor change into the code to make it easier to reuse.

I would be happy to have feedback to know if pull requests like this one can be helpful or not or to view it merged :).
Capture d’écran 2020-10-23 à 22 27 38
Capture d’écran 2020-10-23 à 22 27 46

@LiquidITGuy LiquidITGuy force-pushed the improve-testability branch 4 times, most recently from e6b539d to f8976f7 Compare October 24, 2020 01:19
@LiquidITGuy

This comment has been minimized.

@violoncelloCH violoncelloCH added 3. to review Waiting for reviews feature: app-sidebar Related to the app-sidebar component labels Oct 29, 2020
@LiquidITGuy
Copy link
Author

May I ask for some feedback ?
(If this kind of pr can help to improve testability or fiability of the front, I would be happy to create more pull request during my free time :) )

@skjnldsv
Copy link
Contributor

Hey!!
I'm so sorry we missed it! 🙈
Thank you so much for opening this pr, we'll have a look at it 👁️👄👁️

@skjnldsv
Copy link
Contributor

Could you rebase to master?

@LiquidITGuy
Copy link
Author

Could you rebase to master?

Sure I will do it tomorrow :)

Changed way to stub console in test
 Signed-off-by: Simon Belbeoch <sbelbeoch@octo.com>

Signed-off-by: Simon Belbeoch <simon.belbeoch@octo.com>
 Signed-off-by: Simon Belbeoch <sbelbeoch@octo.com>

Signed-off-by: Simon Belbeoch <simon.belbeoch@octo.com>
Remove the duplicate stub make the test more resilient
 Signed-off-by: Simon Belbeoch <sbelbeoch@octo.com>

Signed-off-by: Simon Belbeoch <simon.belbeoch@octo.com>
 Signed-off-by: Simon Belbeoch <sbelbeoch@octo.com>

Signed-off-by: Simon Belbeoch <simon.belbeoch@octo.com>
 Signed-off-by: Simon Belbeoch <sbelbeoch@octo.com>

Signed-off-by: Simon Belbeoch <simon.belbeoch@octo.com>
 Signed-off-by: Simon Belbeoch <sbelbeoch@octo.com>

Signed-off-by: Simon Belbeoch <simon.belbeoch@octo.com>
 Signed-off-by: Simon Belbeoch <sbelbeoch@octo.com>

Signed-off-by: Simon Belbeoch <simon.belbeoch@octo.com>
 Signed-off-by: Simon Belbeoch <sbelbeoch@octo.com>

Signed-off-by: Simon Belbeoch <simon.belbeoch@octo.com>
 Signed-off-by: Simon Belbeoch <sbelbeoch@octo.com>

Signed-off-by: Simon Belbeoch <simon.belbeoch@octo.com>
@LiquidITGuy
Copy link
Author

@skjnldsv done :)

@skjnldsv
Copy link
Contributor

Very nice!!

Copy link
Contributor

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@skjnldsv skjnldsv merged commit 8ad992f into nextcloud-libraries:master Nov 19, 2020
@skjnldsv
Copy link
Contributor

🎉 🎉 🎉 🎉

@skjnldsv
Copy link
Contributor

Thank you so much @LiquidITGuy
Welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews feature: app-sidebar Related to the app-sidebar component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants