-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[#12588] Added unit tests for CommentTableModalComponent #12609
[#12588] Added unit tests for CommentTableModalComponent #12609
Conversation
…ttps://github.com/kenneySiu/teammates into 12588-Improve-test-code-coverage-of-core-components
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.
thank you for the PR, just a few minor nits!
const testModel: CommentTableModel = { | ||
commentRows: [], | ||
newCommentRow: { | ||
commentEditFormModel: { | ||
commentText: '', | ||
isUsingCustomVisibilities: false, | ||
showCommentTo: [], | ||
showGiverNameTo: [], | ||
}, | ||
isEditing: true, | ||
}, | ||
isAddingNewComment: false, | ||
isReadOnly: false, | ||
}; |
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.
let's abstract this out for multiple tests to use
}); | ||
}); | ||
|
||
it('should trigger an event to delete comment from comments table', () => { |
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.
it('should trigger an event to delete comment from comments table', () => { | |
it('should emit a DeleteCommentEvent with the correct index when triggerDeleteCommentEvent is called', () => { |
let's follow this format when describing tests for event emissions, do the same for the other tests that emit events
…ttps://github.com/kenneySiu/teammates into 12588-Improve-test-code-coverage-of-core-components
Ready for review |
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.
LGTM! thank you for your contribution
Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢 |
1 similar comment
Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢 |
Folks, This PR seems to be stalling (no activities for the past 9 days). 🐌 😢 |
Folks, This PR seems to be stalling (no activities for the past 10 days). 🐌 😢 |
…AMMATES#12609) * Added unit tests to CommentTableModal Component * Fixed test for CommentTableModalComponent * Fixed test for CommentTableModalComponent * fix import on comment-table-modal-compenent tests * Made changes to CommentTableModalComponent tests * Delete space on comment-table-modal.component tests * Added Unit test for sessionEditFormComponent * reverted sessionEditFormComponent tests * fixed issues on session-edit-form-component tests * fixed spacing on sessioneditformcomponent tests * fixed spacing on sessioneditformcomponent tests --------- Co-authored-by: Cedric Ong <[email protected]>
Part of #12588
Outline of Solution
Added unit tests for the following methods in CommentTableModalComponent
ngOnChanges,
triggerDeleteCommentEvent,
triggerUpdateCommentEvent,
triggerSaveNewCommentEvent,
triggerModelChange