-
Notifications
You must be signed in to change notification settings - Fork 246
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
Implement Conditional Rendering of Download Test Result Button #7417
base: master
Are you sure you want to change the base?
Implement Conditional Rendering of Download Test Result Button #7417
Conversation
Add test cases to assign_all, unassign_all, and unassign_single methods
Pull Request Test Coverage Report for Build 13202298251Details
💛 - Coveralls |
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.
@Raine-Yang-UofT nice work! The change is good, but please also add front-end tests for the changes. This is a good chance to learn how to use react-testing-library to test front-end code. 😄
@@ -629,6 +629,7 @@ def summary_json(user) | |||
criteriaColumns: criteria_columns, | |||
numAssigned: self.get_num_assigned(user.instructor? ? nil : user.id), | |||
numMarked: self.get_num_marked(user.instructor? ? nil : user.id), | |||
enableTest: self.assignment_properties&.enable_test || 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.
Oh sorry I didn't catch this earlier, but you can just use self.enable_test
. If you're curious you can learn about the delegate_missing_to
method.
|
||
it("should render the Download Test Results button", async () => { | ||
await waitFor(() => { | ||
expect(screen.getByText(/download test results/i)).toBeInTheDocument(); |
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.
Don't hard-code the string in these tests, and instead use I18n
here to use the localized string. This mirrors what label we assign the button in the application code
Proposed Changes
(Describe your changes here. Also describe the motivation for your changes: what problem do they solve, or how do they improve the application or codebase? If this pull request fixes an open issue, use a keyword to link this pull request to the issue.)
Implement conditional rendering of "download test result" button in assignment summary page such that this button only appears if automated testing is enabled for the assignment.
...
Screenshots of your changes (if applicable)
"Download Test Result" not appearing for an assignment without automated testing.
"Download Test Result" appearing for an assignment with automated testing.
Associated documentation repository pull request (if applicable)
Type of Change
(Write an
X
or a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]
into a[x]
in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request:
Questions and Comments
(Include any questions or comments you have regarding your changes.)