-
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] Improve test code coverage of core components #13050
[#12588] Improve test code coverage of core components #13050
Conversation
Hi @WayyGood, thank you for your interest in contributing to TEAMMATES!
Please address the above before we proceed to review your PR. |
Hi @WayyGood, thanks for the PR. Please fix the failed Github actions. |
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.
SortBy and SortOrder are not imported
add
import { SortBy, SortOrder } from '../../../../types/sort-properties';
to the top of the file
it('should open modal and set currResponseToAdd when showCommentTableModel is called', () => { | ||
const selectedResponse: ResponseOutput = { /* mock response */ }; | ||
const modalResultPromise = new Promise(resolve => resolve()); | ||
const commentModalRef: NgbModalRef = { |
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 an import for NgbModelRef
import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
const responseWithoutMissing: ResponseOutput = { isMissingResponse: false }; | ||
component.responses = [responseWithMissing, responseWithoutMissing]; | ||
|
||
component.filterResponses(); |
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.
private methods cannot be called from your test
you can call filterResponses() indirectly with ngOnInit() or ngOnChanges() because they both run this.filterResponses()
Closing due to inactivity |
PR title: [#12588] Improve test code coverage of core components
(PerQuestionViewResponsesComponent)
Outline of Solution
added testing for some uncovered functions