Skip to content

Commit

Permalink
unskip test suite
Browse files Browse the repository at this point in the history
remove accidental skipping of test suite with a it.only in jest test
and fix some other tests with badge count changes

closes EVAL-4119

flag=assignment_2_student

test plan:
- tests pass

Change-Id: Ia40c084322077de23f6f2c4fce79a3c6242d16ed
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/345692
Reviewed-by: Cameron Ray <cameron.ray@instructure.com>
QA-Review: Cameron Ray <cameron.ray@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
  • Loading branch information
rohanchugh14 committed Apr 19, 2024
1 parent e02580e commit 49bd7ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Expand Up @@ -150,6 +150,7 @@ export default ({
renderIcon={IconChatLine}
onClick={openCommentTray}
disabled={addCommentsDisabled}
data-testid="view_feedback_button"
>
{showFeedback ? I18n.t('View Feedback') : I18n.t('Add Comment')}
</Button>
Expand Down
Expand Up @@ -811,16 +811,17 @@ describe('Assignment Student Content View', () => {
})

it('shows the unread comments badge if there are unread comments', async () => {
const props = await mockAssignmentAndSubmission({Submission: {unreadCommentCount: 1}})
const props = await mockAssignmentAndSubmission({Submission: {unreadCommentCount: 1, feedbackForCurrentAttempt: true}})
const {getByTestId} = render(
<MockedProvider>
<StudentContent {...props} />
</MockedProvider>
)
expect(getByTestId('view_feedback_button')).toHaveTextContent('View Feedback')
expect(getByTestId('unread_comments_badge')).toBeInTheDocument()
})

it.only('does not show unread comments if the assignment grade is not posted', async () => {
it('does not show unread comments if the assignment grade is not posted', async () => {
const props = await mockAssignmentAndSubmission({
Submission: {unreadCommentCount: 1, feedbackForCurrentAttempt: false},
})
Expand Down Expand Up @@ -1000,13 +1001,14 @@ describe('Assignment Student Content View', () => {
})

it('shows the unread comments badge if peerReviewModeEnabled is set to false', async () => {
const props = await mockAssignmentAndSubmission({Submission: {unreadCommentCount: 1}})
const props = await mockAssignmentAndSubmission({Submission: {unreadCommentCount: 1, feedbackForCurrentAttempt: true}})
props.assignment.env.peerReviewModeEnabled = false
const {getByTestId} = render(
<MockedProvider>
<StudentContent {...props} />
</MockedProvider>
)
expect(getByTestId('view_feedback_button')).toHaveTextContent('View Feedback')
expect(getByTestId('unread_comments_badge')).toBeInTheDocument()
})
})
Expand Down

0 comments on commit 49bd7ae

Please sign in to comment.