-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
refactor: Departments to typescript conversion and e2e tests #27792
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #27792 +/- ##
===========================================
+ Coverage 40.15% 44.82% +4.66%
===========================================
Files 737 762 +25
Lines 14463 14800 +337
Branches 2033 2092 +59
===========================================
+ Hits 5808 6634 +826
+ Misses 8380 7870 -510
- Partials 275 296 +21
Flags with carried forward coverage won't be shown. Click here to find out more. |
const newAgent = { ...user, agentId: user?._id } as unknown as ILivechatDepartmentAgents; | ||
setAgentList([newAgent, ...agentList]); | ||
setUserId(''); | ||
setAgentsAdded((agents) => [...agents, { agentId: user?._id }]); // Search the real type of setAgentsAdded and type the function on the root props |
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.
setAgentsAdded((agents) => [...agents, { agentId: user?._id }]); // Search the real type of setAgentsAdded and type the function on the root props | |
setAgentsAdded((agents) => [...agents, { agentId: user?._id }]); |
Is this comment still necessary?
agentId: Key; | ||
username: string; | ||
name?: string; | ||
avatarETag?: string; | ||
mediaQuery: boolean; |
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.
agentId: Key; | |
username: string; | |
name?: string; | |
avatarETag?: string; | |
mediaQuery: boolean; | |
agentId: ILivechatDepartmentAgents['_id']; | |
username: ILivechatDepartmentAgents['username']; | |
name?: ILivechatDepartmentAgents['name']; | |
avatarETag?: ILivechatDepartmentAgents['avatarETag']; | |
mediaQuery: ILivechatDepartmentAgents['mediaQuery']; |
You can use the ILivechatDepartmentAgents
type here, but you must also have to update the type.
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 this case, the properties: name, avatarETag and mediaQuery is not part of ILivechatDepartmentsAgents type, what should I do with them?
@@ -68,6 +68,10 @@ export class OmnichannelDepartments { | |||
return this.page.locator('table tr:first-child td:first-child'); | |||
} | |||
|
|||
get btnDeleteFirstRowInTable() { | |||
return this.page.locator('table tr:first-child td:nth-child(6) button'); |
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.
return this.page.locator('table tr:first-child td:nth-child(6) button'); | |
return this.page.locator('button[title="Remove"]'); |
does it work?
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.
Won't this conflict in the bad case there's other "remove" button around? 👀
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.
This line was added but this isn't needed because of the new changes hehe, so I will delete this function
Due to conflicts and also convenience, changes proposed on this PR were moved to #28948. |
In this PR I converted the omnichannel department files from javascript to typescript and create some tests for the add and remove agents functionalities.
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments
OC-608