Fixes on OutcomesPopover.test.js
flag=none test plan: - Specs pass qa risk: low Change-Id: Ie3f724d13eaa0c6f0acb49e8af0d957bf4338860 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274276 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
23e94574cd
commit
51dea1be2f
|
@ -130,13 +130,12 @@ const ignoredErrors = [
|
|||
/The prop `ltiKeysSetLtiKey` is marked as required in `DeveloperKeyActionButtons`/,
|
||||
/The prop `name` is marked as required in `Avatar`/,
|
||||
/The prop `onChangeSubmission` is marked as required in `StudentContent`/,
|
||||
/The prop `onClearHandler` is marked as required in `(ManageOutcomesFooter|OutcomesPopover)`/,
|
||||
/The prop `onClearHandler` is marked as required in `(ManageOutcomesFooter)`/,
|
||||
/The prop `onSelect` is marked as required in `MailboxSelectionDropdown`/,
|
||||
/The prop `outcome.mastery_points` is marked as required in `StudentOutcomeScore`/,
|
||||
/The prop `outcome.title` is marked as required in `StudentOutcomeScore`/,
|
||||
/The prop `outcomeGroup._id` is marked as required in `GroupDescriptionModal`/,
|
||||
/The prop `outcomeGroup.title` is marked as required in `(GroupDescriptionModal|GroupEditModal|ManageOutcomesView)`/,
|
||||
/The prop `outcomes.1._id` is marked as required in `OutcomesPopover`/,
|
||||
/The prop `outcomes\[0\].mastery_points` is marked as required in `(Gradebook|ScoresGrid)`/,
|
||||
/The prop `permissionName` is marked as required in `PermissionTray`/,
|
||||
/The prop `pollTimeout` is marked as required in `LinkValidator`/,
|
||||
|
|
|
@ -39,7 +39,8 @@ describe('ManageOutcomesFooter', () => {
|
|||
selected: generateOutcomes(numberToGenerate, canUnlink),
|
||||
selectedCount: numberToGenerate,
|
||||
onRemoveHandler: onRemoveHandlerMock,
|
||||
onMoveHandler: onMoveHandlerMock
|
||||
onMoveHandler: onMoveHandlerMock,
|
||||
onClearHandler: jest.fn()
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
|
|
|
@ -29,8 +29,10 @@ describe('OutcomesPopover', () => {
|
|||
(acc, _curr, idx) => ({
|
||||
...acc,
|
||||
[idx + 1]: {
|
||||
linkId: idx + 1,
|
||||
title: `Outcome ${idx + 1}`
|
||||
_id: (idx + 1).toString(),
|
||||
linkId: (idx + 1).toString(),
|
||||
title: `Outcome ${idx + 1}`,
|
||||
canUnlink: false
|
||||
}
|
||||
}),
|
||||
{}
|
||||
|
@ -84,14 +86,16 @@ describe('OutcomesPopover', () => {
|
|||
it('shows outcomes in alphanumerical order', async () => {
|
||||
const props = {
|
||||
outcomes: {
|
||||
22: {linkId: '22', title: 'Outcome 22'},
|
||||
1: {linkId: '1', title: 'Outcome 1'},
|
||||
2: {linkId: '2', title: 'Outcome 2'},
|
||||
12: {linkId: '12', title: 'Outcome 12'}
|
||||
22: {_id: '22', linkId: '22', title: 'Outcome 22', canUnlink: false},
|
||||
1: {_id: '1', linkId: '1', title: 'Outcome 1', canUnlink: false},
|
||||
2: {_id: '2', linkId: '2', title: 'Outcome 2', canUnlink: false},
|
||||
12: {_id: '12', linkId: '12', title: 'Outcome 12', canUnlink: false}
|
||||
},
|
||||
outcomeCount: 4
|
||||
}
|
||||
const {findAllByText, getByRole} = render(<OutcomesPopover {...props} />)
|
||||
const {findAllByText, getByRole} = render(
|
||||
<OutcomesPopover {...props} onClearHandler={onClearHandlerMock} />
|
||||
)
|
||||
const button = getByRole('button')
|
||||
fireEvent.click(button)
|
||||
await act(async () => jest.runOnlyPendingTimers())
|
||||
|
|
Loading…
Reference in New Issue