░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
pplmvsvm
LOCATION:
/var/www/canvas/ui/shared/proxy-submission/react/__tests__
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: ProxyUploadModal.test.tsx
/* * Copyright (C) 2022 - 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 React from 'react' import {render, waitFor} from '@testing-library/react' import userEvent from '@testing-library/user-event' import ProxyUploadModal, {ProxyUploadModalProps} from '../ProxyUploadModal' const defaultProps: ProxyUploadModalProps = { student: { id: '50', name: 'Penny Lane', }, submission: { id: '2501', }, assignment: { courseId: '1', id: '31', }, open: true, onClose: () => Promise.resolve(true), reloadSubmission: () => Promise.resolve(true), } function renderComponent(overrideProps = {}) { const props = {...defaultProps, ...overrideProps} return render(<ProxyUploadModal {...props} />) } describe('ProxyUploadModal', () => { it('renders', () => { const {getByText} = renderComponent() expect(getByText('Upload File')).toBeInTheDocument() }) it('indicates files are being uploaded once added to input', async () => { const {getByTestId, getAllByText} = renderComponent() const input = await waitFor(() => getByTestId('proxyInputFileDrop')) const file = new File(['my-image'], 'my-image.png', {type: 'image/png'}) userEvent.upload(input, file) expect(getAllByText('Uploading files')[0]).toBeInTheDocument() }) })
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 ProxyUploadModal.test.tsx
TSX
1.9 KB
2023-09-24 03:39
EDIT