-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
#267: Create Context for song and playlist currently being played #272
#267: Create Context for song and playlist currently being played #272
Conversation
@AntonioMrtz created a context not yet used anywhere |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace changeSongName
passed as parameter (prop drilling) with the use of the context. Also add tests for the new functionality.
Run npm run lint
because I saw some issues with linting.
@AntonioMrtz fixed lint issue and remove prop drilling and used custom hook in every component which is using changSongName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add useMemo + review failing tests + add tests for the new functionality
Electron/src/components/ShowAllItems/types/PropsShowAllItems.ts
Outdated
Show resolved
Hide resolved
@AntonioMrtz all changes are done as you said. and tested functionality which is working well. |
Not only manually test the functionality, but also add unit tests to the code about the implemented functionality :) The looks code looks good, but we should check failing tests with |
@AntonioMrtz All new test are added and unit test are done by my side and they are passing plz check |
Hi @SaurabhGurde , code looks code. Yeah, unit tests are fixed but I'm missing a new unit test that validates whether the playing song's state is being correctly modified. Once the new test is being added to the codebase I will do a last in-depth review of the code and merge if everything is correct |
I did not understand plz explain more |
Code looks good hehe, it was a typo, my bad. I was saying that the following is required:
After that, I will review the code for a last time and merge the code :) |
@AntonioMrtz added a test but i feel that it may be wrong or missing something plz check |
New test is failing, did you check the result before pushing it? |
Yes I use command npm run lint everytime before pushing. But nom run test fails because we are using dummy data for api testing due to which it gives error "cannot read property map of undefined" because api don't send anything so it tries to apply map on undefined variable |
Thats the point, mocking the data, if the data is empty ofc is going to fail. Whats the purpose of the test if it fails or only works with the app launched? |
I will do the tests this time, but I'm not accepting any PR without working tests :) |
const artistMockFetch = { we are using "artistMockFetch.name" this dummy data for to call API to get song list for testing and "songMockFetch.name" to check whether current song being playing is present in footer or not. but its fake data so api dont give any data and test will fail. we have to use real song name data of currently logged in user. Thats what i wanted to ask how to get real data of logged in user to add it in test.tsx file and test api. |
Description
Created a global context for changing song from any component without prop drilling
Commit type
feat
: indicates the addition of a new feature or functionality to the project.Issue
#267
Solution
created song change context in useSongChangeContextApi.tsx file a custom hook which can used anywhere in any component to change global current song.
Proposed Changes
Potential Impact
Screenshots
Additional Tasks
Assigned
@AntonioMrtz