NIAEFEUP / nijobs-fe

[FRONTEND] A platform for companies to advertise their job opportunities to students
GNU General Public License v3.0
23 stars 3 forks source link

Feature/239 evident see offers wo user parameters #286

Closed tomaspalma closed 1 year ago

tomaspalma commented 1 year ago

Closes #239. The solution implemented was displaying a "search" button when there were no user specified filters nor any value in the search bar. Then, when the user chooses a filter or writes something in the search bar, it changes the button text to "search"

image

image

image

Naapperas commented 1 year ago

@tomaspalma You need to fix the failing test, since the current behavior will change.

tomaspalma commented 1 year ago

@tomaspalma You need to fix the failing test, since the current behavior will change.

It is now fixed.

Should we also add tests to see if the searchHasUserInput variable is set to the correct value when the search bar isn't empty and when any filters are activated? because this test only tests if the behaviour is correct when a certain value of searchHasUserInput is set but it doesn't validate that the value of the searchHasUserInput is correctly set under the supposed circumstances.

Also, I have a question in the file I worked on. Why is that the component name in the SubmitSearchButton.js file is called "ShowAdvancedOptionsButton"?

codecov-commenter commented 1 year ago

Codecov Report

Base: 88.97% // Head: 88.99% // Increases project coverage by +0.01% :tada:

Coverage data is based on head (76c12f3) compared to base (8fa5a07). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #286 +/- ## =========================================== + Coverage 88.97% 88.99% +0.01% =========================================== Files 175 175 Lines 3302 3307 +5 Branches 829 834 +5 =========================================== + Hits 2938 2943 +5 Misses 364 364 ``` | [Impacted Files](https://codecov.io/gh/NIAEFEUP/nijobs-fe/pull/286?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NIAEFEUP) | Coverage Δ | | |---|---|---| | [src/components/HomePage/SearchArea/SearchArea.js](https://codecov.io/gh/NIAEFEUP/nijobs-fe/pull/286?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NIAEFEUP#diff-c3JjL2NvbXBvbmVudHMvSG9tZVBhZ2UvU2VhcmNoQXJlYS9TZWFyY2hBcmVhLmpz) | `100.00% <100.00%> (ø)` | | | [...mponents/HomePage/SearchArea/SubmitSearchButton.js](https://codecov.io/gh/NIAEFEUP/nijobs-fe/pull/286?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NIAEFEUP#diff-c3JjL2NvbXBvbmVudHMvSG9tZVBhZ2UvU2VhcmNoQXJlYS9TdWJtaXRTZWFyY2hCdXR0b24uanM=) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NIAEFEUP). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NIAEFEUP)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

Naapperas commented 1 year ago

@tomaspalma the only thing missing in this is to write the test that we talked about in a meeting, or is there something else?

Other than that, you'll need to rebase this with develop

Naapperas commented 1 year ago

@tomaspalma The failing tests may need more props that are mandatory.

tomaspalma commented 1 year ago

@tomaspalma The failing tests may need more props that are mandatory.

I was unsure if there was something really missing on the props or whether it was some other issue because locally running npm test the result was an all-green suite. It was only failing with the ci tests.

But now seeing what you said and looking at the other tests that render searchArea in searchArea.spec.js, the component is being rendered in those tests with some props I'm not passing in the tests I created, including the one that is saying not to be defined in the error report of the ci tests, the other props probably aren't showing as undefined because setShowJobDurationSlider appears first in the searchArea component code, so it may be that.

Update: The tests we failling locally because I had an outdated version of the program code, because I had forgotten to rebase with develop.

tomaspalma commented 1 year ago

It is not ready yet, there's still an issue that came up after updating the changes on develop and the searchValue comes initially as undefined instead of empty string, so the show all button is not currently showing at start.

Naapperas commented 1 year ago

It is not ready yet, there's still an issue that came up after updating the changes on develop and the searchValue comes initially as undefined instead of empty string, so the show all button is not currently showing at start.

Maybe you can change the initial value of the redux state for the offerSearch, it is defined in the offer's reducer if I'm not mistaken.

Another option is to check if it is undefined.

tomaspalma commented 1 year ago

I think it's pratically done now, already fixed show all not showing at start and also added the search area wrapper to improve readiblity in the tests. Contrarily to the example you gave me, I had to specify the prop types because the linter was giving me warnings about not specifying the types for them.

Naapperas commented 1 year ago

I think it's pratically done now, already fixed show all not showing at start and also added the search area wrapper to improve readiblity in the tests. Contrarily to the example you gave me, I had to specify the prop types because the linter was giving me warnings about not specifying the types for them.

Just as a future reference you can instruct the linter to ignore those warnings, which is useful for cases like this one.