Skip to content
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

Conversation

kenneySiu
Copy link
Contributor

Part of #12588

Outline of Solution
Added unit tests for the following methods in CommentTableModalComponent
ngOnChanges,
triggerDeleteCommentEvent,
triggerUpdateCommentEvent,
triggerSaveNewCommentEvent,
triggerModelChange

@cedricongjh cedricongjh self-assigned this Oct 18, 2023
@cedricongjh cedricongjh self-requested a review October 18, 2023 13:06
Copy link
Contributor

@cedricongjh cedricongjh left a 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!

Comment on lines 60 to 73
const testModel: CommentTableModel = {
commentRows: [],
newCommentRow: {
commentEditFormModel: {
commentText: '',
isUsingCustomVisibilities: false,
showCommentTo: [],
showGiverNameTo: [],
},
isEditing: true,
},
isAddingNewComment: false,
isReadOnly: false,
};
Copy link
Contributor

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', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

@kenneySiu
Copy link
Contributor Author

Ready for review

Copy link
Contributor

@cedricongjh cedricongjh left a 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

@cedricongjh cedricongjh added the s.FinalReview The PR is ready for final review label Oct 19, 2023
@nusoss-bot
Copy link

Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢
Hope someone can get it to move forward again soon...

1 similar comment
@nusoss-bot
Copy link

Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢
Hope someone can get it to move forward again soon...

@nusoss-bot
Copy link

Folks, This PR seems to be stalling (no activities for the past 9 days). 🐌 😢
Hope someone can get it to move forward again soon...

@cedricongjh cedricongjh merged commit 752272e into TEAMMATES:master Dec 2, 2023
9 checks passed
@nusoss-bot
Copy link

Folks, This PR seems to be stalling (no activities for the past 10 days). 🐌 😢
Hope someone can get it to move forward again soon...

@wkurniawan07 wkurniawan07 removed the s.FinalReview The PR is ready for final review label Jan 21, 2024
@wkurniawan07 wkurniawan07 added s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging c.Task Other non-user-facing works, e.g. refactoring, adding tests labels Jan 21, 2024
@wkurniawan07 wkurniawan07 added this to the V8.30.0 milestone Jan 21, 2024
cedricongjh added a commit to cedricongjh/teammates that referenced this pull request Feb 20, 2024
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c.Task Other non-user-facing works, e.g. refactoring, adding tests s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants