-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(retain-old-grading-data-option): repo_browser_manual_collection_…
…form
- Loading branch information
1 parent
76e1739
commit 70a407b
Showing
4 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
app/assets/javascripts/Components/__tests__/repo_browser_manual_collection_form.test.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import * as React from "react"; | ||
import {render, screen} from "@testing-library/react"; | ||
import {ManualCollectionForm} from "../repo_browser"; | ||
|
||
describe("RepoBrowser's ManualCollectionForm", () => { | ||
let props, component; | ||
|
||
beforeEach(() => { | ||
props = { | ||
course_id: 1, | ||
assignment_id: 2, | ||
late_penalty: false, | ||
grouping_id: 1, | ||
revision_identifier: "test", | ||
collected_revision_id: "test", | ||
}; | ||
|
||
// Set the app element for React Modal | ||
component = render(<ManualCollectionForm {...props} />); | ||
}); | ||
|
||
it("shows the option to retain existing grading when there is a collected revision present", () => { | ||
const lblRecollectExistingSubmissions = screen.getByTestId("lbl_retain_existing_grading"); | ||
const chkRecollectExistingSubmissions = screen.getByTestId("chk_retain_existing_grading"); | ||
|
||
expect(lblRecollectExistingSubmissions).toBeInTheDocument(); | ||
expect(chkRecollectExistingSubmissions).toBeInTheDocument(); | ||
}); | ||
|
||
it("does not show the option to retain existing grading when there is a not collected revision present", () => { | ||
props.collected_revision_id = ""; | ||
component.rerender(<ManualCollectionForm {...props} />); | ||
|
||
const lblRecollectExistingSubmissions = screen.queryByTestId("lbl_retain_existing_grading"); | ||
const chkRecollectExistingSubmissions = screen.queryByTestId("chk_retain_existing_grading"); | ||
|
||
expect(lblRecollectExistingSubmissions).not.toBeInTheDocument(); | ||
expect(chkRecollectExistingSubmissions).not.toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters