forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes VICE-1090 flag=react_inbox Test Plan: - Enable react inbox feature flag - Follow the steps in the following confluence doc to get kaltura working locally - https://instructure.atlassian.net/wiki/spaces/ENG/pages/45645877/Enable+the+Notorious+Plugin+Replacement+for+Kaltura - Navigate to the inbox and open the compose modal - Click the "add media comment" button on the bottom left of the compose modal - record or upload a media file - The media uplaod should display below the rest of the header inputs - Click the x button to remove the media comment - Create a conversation with a media comment - Inspect the graphql response and note the presence of the media comment Change-Id: I6a9af8f1d0ba6473ee8262a148ccd5561dda1336 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275995 Tested-by: Service Cloud Jenkins <[email protected]> Reviewed-by: Rob Orton <[email protected]> Reviewed-by: Drake Harper <[email protected]> Product-Review: Drake Harper <[email protected]> QA-Review: Drake Harper <[email protected]>
- Loading branch information
1 parent
e069e51
commit 8b5d979
Showing
10 changed files
with
229 additions
and
18 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
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
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
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
67 changes: 67 additions & 0 deletions
67
ui/features/inbox/react/containers/ComposeModalContainer/__tests__/HeaderInputs.test.js
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,67 @@ | ||
/* | ||
* Copyright (C) 2020 - present Instructure, Inc. | ||
* | ||
* This file is part of Canvas. | ||
* | ||
* Canvas is free software: you can redistribute it and/or modify it under | ||
* the terms of the GNU Affero General Public License as published by the Free | ||
* Software Foundation, version 3 of the License. | ||
* | ||
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY | ||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License along | ||
* with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import {Course} from '../../../../graphql/Course' | ||
import {Enrollment} from '../../../../graphql/Enrollment' | ||
import {fireEvent, render} from '@testing-library/react' | ||
import {Group} from '../../../../graphql/Group' | ||
import HeaderInputs from '../HeaderInputs' | ||
import React from 'react' | ||
|
||
describe('HeaderInputs', () => { | ||
const defaultProps = () => ({ | ||
courses: { | ||
favoriteGroupsConnection: { | ||
nodes: [Group.mock()] | ||
}, | ||
favoriteCoursesConnection: { | ||
nodes: [Course.mock()] | ||
}, | ||
enrollments: [Enrollment.mock()] | ||
}, | ||
onContextSelect: jest.fn(), | ||
onSendIndividualMessagesChange: jest.fn(), | ||
onSubjectChange: jest.fn(), | ||
onRemoveMediaComment: jest.fn() | ||
}) | ||
|
||
describe('Media Comments', () => { | ||
it('does not render a media comment if one is not provided', () => { | ||
const container = render(<HeaderInputs {...defaultProps()} />) | ||
expect(container.queryByTestId('media-attachment')).toBeNull() | ||
}) | ||
|
||
it('does render a media comment if one is provided', () => { | ||
const container = render( | ||
<HeaderInputs {...defaultProps()} mediaAttachmentTitle="I am Lord Lemon" /> | ||
) | ||
expect(container.getByTestId('media-attachment')).toBeInTheDocument() | ||
expect(container.getByText('I am Lord Lemon')).toBeInTheDocument() | ||
}) | ||
|
||
it('calls the onRemoveMediaComment callback when the remove media button is clicked', () => { | ||
const props = defaultProps() | ||
const container = render( | ||
<HeaderInputs {...props} mediaAttachmentTitle="No really I am Lord Lemon" /> | ||
) | ||
const removeMediaButton = container.getByTestId('remove-media-attachment') | ||
fireEvent.click(removeMediaButton) | ||
expect(props.onRemoveMediaComment).toHaveBeenCalled() | ||
}) | ||
}) | ||
}) |
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
Oops, something went wrong.