Fixes on RubricTab.test.js
flag=none test plan: - Specs pass qa risk: low Change-Id: I34689ab421cbf311276b7981997c9dda0f6cd53b Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274176 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Davis Hyer <dhyer@instructure.com> QA-Review: Davis Hyer <dhyer@instructure.com> Product-Review: Davis Hyer <dhyer@instructure.com>
This commit is contained in:
parent
51dea1be2f
commit
7a58380d0a
|
@ -152,7 +152,6 @@ const ignoredErrors = [
|
||||||
/The prop `rubric.criteria\[0\].id` is marked as required in `Rubric`/,
|
/The prop `rubric.criteria\[0\].id` is marked as required in `Rubric`/,
|
||||||
/The prop `rubric.id` is marked as required in `RubricTab`/,
|
/The prop `rubric.id` is marked as required in `RubricTab`/,
|
||||||
/The prop `rubricAssessment.data\[0\].criterion_id` is marked as required in `Rubric`/,
|
/The prop `rubricAssessment.data\[0\].criterion_id` is marked as required in `Rubric`/,
|
||||||
/The prop `rubricAssociation._id` is marked as required in `RubricTab`/,
|
|
||||||
/The prop `screenReaderLabel` is marked as required in `IconButton`/,
|
/The prop `screenReaderLabel` is marked as required in `IconButton`/,
|
||||||
/The prop `selectedRoles\[0\].value` is marked as required in `PermissionsIndex`/,
|
/The prop `selectedRoles\[0\].value` is marked as required in `PermissionsIndex`/,
|
||||||
/The prop `text` is marked as required in `(SVGWithTextPlaceholder|TextPlaceholder)`/,
|
/The prop `text` is marked as required in `(SVGWithTextPlaceholder|TextPlaceholder)`/,
|
||||||
|
|
|
@ -136,7 +136,7 @@ describe('RubricTab', () => {
|
||||||
|
|
||||||
it('shows possible points if the association does not hide points', async () => {
|
it('shows possible points if the association does not hide points', async () => {
|
||||||
const props = await makeProps({graded: false})
|
const props = await makeProps({graded: false})
|
||||||
props.rubricAssociation = {}
|
props.rubricAssociation = {_id: '1', hide_score_total: false, use_for_grading: false}
|
||||||
|
|
||||||
const {findByText, getByRole} = render(<RubricTab {...props} />)
|
const {findByText, getByRole} = render(<RubricTab {...props} />)
|
||||||
fireEvent.click(getByRole('button', {name: /View Rubric/}))
|
fireEvent.click(getByRole('button', {name: /View Rubric/}))
|
||||||
|
@ -146,7 +146,12 @@ describe('RubricTab', () => {
|
||||||
|
|
||||||
it('does not show possible points for criteria if the association hides points', async () => {
|
it('does not show possible points for criteria if the association hides points', async () => {
|
||||||
const props = await makeProps({graded: false})
|
const props = await makeProps({graded: false})
|
||||||
props.rubricAssociation = {hide_points: true}
|
props.rubricAssociation = {
|
||||||
|
_id: '1',
|
||||||
|
hide_score_total: false,
|
||||||
|
use_for_grading: false,
|
||||||
|
hide_points: true
|
||||||
|
}
|
||||||
|
|
||||||
const {queryByText, getByRole} = render(<RubricTab {...props} />)
|
const {queryByText, getByRole} = render(<RubricTab {...props} />)
|
||||||
fireEvent.click(getByRole('button', {name: /View Rubric/}))
|
fireEvent.click(getByRole('button', {name: /View Rubric/}))
|
||||||
|
@ -171,7 +176,12 @@ describe('RubricTab', () => {
|
||||||
|
|
||||||
it('hides the points for an individual criterion if the association hides points', async () => {
|
it('hides the points for an individual criterion if the association hides points', async () => {
|
||||||
const props = await makeProps({graded: true})
|
const props = await makeProps({graded: true})
|
||||||
props.rubricAssociation = {hide_points: true}
|
props.rubricAssociation = {
|
||||||
|
_id: '1',
|
||||||
|
hide_score_total: false,
|
||||||
|
use_for_grading: false,
|
||||||
|
hide_points: true
|
||||||
|
}
|
||||||
|
|
||||||
const {queryByText} = render(<RubricTab {...props} />)
|
const {queryByText} = render(<RubricTab {...props} />)
|
||||||
expect(queryByText('6 / 6 pts')).not.toBeInTheDocument()
|
expect(queryByText('6 / 6 pts')).not.toBeInTheDocument()
|
||||||
|
|
Loading…
Reference in New Issue