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

Edit people_skill spec test fixing #751

Open
4 tasks
ManuelMoeri opened this issue Jul 19, 2024 · 0 comments
Open
4 tasks

Edit people_skill spec test fixing #751

ManuelMoeri opened this issue Jul 19, 2024 · 0 comments

Comments

@ManuelMoeri
Copy link
Collaborator

ManuelMoeri commented Jul 19, 2024

Introduction
First off, head to the edit_people_skills_spec.rb file and scroll to the test 'can edit people-skills' which should be on line 27. Then see what the test does. If you take a look at the 'validate_people_skill method' which is located in the people_skills_helper you will find even more validate methods called. Take a look at the 'validate_interest' method. You will see that the current implementation of validating interests is by checking the color of the filled out stars. This functionality should be replaced by simply checking if the star has been checked.

How does it work
Well the validation simply checks if the star(s) have the color they should have when beeing filled out / checked. Yet there is one important detail that has been forgotten. The hover effect. The hover effect displays a whole new color. How is that a problem? Well when capybara clicks on the star, the hover effect simply does not go away and the test fails.

Why is this important?
As a quick fix there is a line in the code that simply hovers another element to fix all of this.
find('#person_people_skills_attributes_0_certificate').hover

The reason why this is harder than it seems is because the 'interest' param, does not seem to be correct. You will need to take a good look at that as well because it's reversed for some reason. This spec should change because of these reasons:

  • The unnecessary line of code can be removed
  • The test would be more clean and readable
  • It's way shorter to just check if the star has been checked

ToDo

  • Re-write the test with to be_checked
  • Make sure all tests still pass
  • Review
  • Merge
    Ⓜ️Ⓜ️
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

1 participant