-
Notifications
You must be signed in to change notification settings - Fork 152
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
AssignTask to rtk #699
AssignTask to rtk #699
Conversation
@WYGIN is attempting to deploy a commit to the RDS-Team Team on Vercel. A member of the Team first needs to authorize it. |
Please add the test coverage screenshot of the changes |
4123e2b
to
bc04ca3
Compare
Add the test coverage report of your changes only @WYGIN |
.eslintrc.json
Outdated
@@ -18,7 +18,7 @@ | |||
"plugins": ["react", "@typescript-eslint"], | |||
"rules": { | |||
"linebreak-style": ["error", "unix"], | |||
"quotes": ["error", "single"], | |||
"quotes": ["error", "single", { "avoidEscape": true }], |
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.
Why are we adding this rule here?
We should follow one
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.
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.
In that case, we should fix the prettier and eslint configurations, rather than just adding some rule to make precommits pass
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.
In that case, we should fix the prettier and eslint configurations, rather than just adding some rule to make precommits pass
i searched a lot to fix that issue but not found any solution for it, so i reverted my code to use defalut lint rules
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.
if you face an issue that is not linked to your PR, please create a separate issue ticket and PR for it
73ab104
to
4bd3552
Compare
id: 'aTOG168A86JXY5wVosJx', | ||
github_display_name: 'Mahima Khandelwal', | ||
github_id: 'Maheima', | ||
roles: { | ||
member: true, | ||
archived: false, | ||
super_user: false, | ||
}, | ||
last_name: 'Khandelwal', | ||
username: 'mahima', | ||
incompleteUserDetails: false, | ||
profileStatus: 'BLOCKED', | ||
picture: { | ||
publicId: 'profile/aTOG168A86JXY5wVosJx/fj2c46kpmpy3gi8tl63s', | ||
url: 'https://res.cloudinary.com/realdevsquad/image/upload/v1674639637/profile/aTOG168A86JXY5wVosJx/fj2c46kpmpy3gi8tl63s.jpg' | ||
}, | ||
status: 'active', | ||
first_name: 'Mahima', | ||
profileURL: 'https://mahima-profile-service.onrender.com' |
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.
Please use dummy data for test
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.
done
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.
Where?
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.
Where?
That data is not created by me i refactored it tor DRY them up but now i replaced my tests with duplicate data in path __ tests __/Unit/hooks/tasksApi.test.tsx so no more tests depending on that data in my tests, the file is renamed from a js file to ts file https://github.com/Real-Dev-Squad/website-status/pull/699/files#diff-6e68b838da6a1b199fcb4ef878d985dd3e29de628b6bbbcdaca7cf99de329d3e
export const urlPattern = | ||
/(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?\/[a-zA-Z0-9]{2,}|((https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?)|(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})?/g; |
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.
What pattern are we matching here?
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.
What pattern are we matching here?
i changed that pattern with a simple relative url pattern please check it
…relative urls only
expect(unAssignedTaskNodes).toHaveLength(10); | ||
expect(unAssignedTaskNodes[0]).toBeVisible(); | ||
expect(unAssignedTaskNodes[6]).toBeVisible(); | ||
getByText('Akash Shukla'); |
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.
didn't understand why is this written at the end.
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.
didn't understand why is this written at the end.
That line is to test if the member is in document or not. It will throw an error if the member is not in document or if that same member is in document for more than one time, resulting in test failure AFAIK
I would also add toBeVisible in my next commit so that it assures that component is rendering member
|
||
transformResponse: (response: TasksResponseType) => { | ||
return { | ||
tasks: response.tasks?.sort( | ||
tasks: [...response.tasks].sort( |
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.
why made this change?
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.
why made this change?
The previous code might mutate the response, so i created a new array and pass the required changes without mutating the response
src/constants/payload.js
Outdated
message: 'Task cannot be assigned to users with active or OOO status', | ||
}; | ||
|
||
export function taskAssigned(Id) { |
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.
If this is a constants file, it should have this function
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.
good work on the tests, left few comments, please address them
Tests are failing please look into it |
Issue: #671
Description:
migrated AssignTask api from Axios to RTK & wrote Tests to check AssignTask RTK mutation
Anything you would like to inform the reviewer about:
Dev Tested:
Test Coverage
Images/video of the change:
AssignTaskToRTK.mp4
Follow-up Issues (if any)
not due to my changes but the task assigned is not getting invisible until the next page reload if i try to assign first task, but the last task in the list is getting invisible after i assigned it.