░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
pplmvsvm
LOCATION:
/var/www/canvas/ui/features/course_paces/react/utils/__tests__
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: slide_transition.test.tsx
// @ts-nocheck /* * Copyright (C) 2021 - 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 SlideTransition from '../slide_transition' const renderComponent = props => render( <SlideTransition size={100} {...props}> <span>Hey look it's me!</span> </SlideTransition> ) describe('SlideTransition', () => { it('shows child components when expanded', () => { const {getByText} = renderComponent({direction: 'vertical', expanded: true}) expect(getByText("Hey look it's me!")).toBeInTheDocument() }) it('hides child components when collapsed', async () => { const {queryByText} = renderComponent({direction: 'vertical', expanded: false}) await waitFor(() => expect(queryByText("Hey look it's me!")).not.toBeInTheDocument()) }) it('shrinks vertically when collapsed', () => { const {getByTestId} = renderComponent({direction: 'vertical', expanded: false}) expect(getByTestId('course-paces-collapse').style.getPropertyValue('max-height')).toBe('0') }) it('restores height when expanded', () => { const {getByTestId} = renderComponent({direction: 'vertical', expanded: true}) expect(getByTestId('course-paces-collapse').style.getPropertyValue('max-height')).toBe('100px') }) it('shrinks horizontally when collapsed', () => { const {getByTestId} = renderComponent({direction: 'horizontal', expanded: false}) expect(getByTestId('course-paces-collapse').style.getPropertyValue('width')).toBe('0px') }) it('restores width when expanded', () => { const {getByTestId} = renderComponent({direction: 'horizontal', expanded: true}) expect(getByTestId('course-paces-collapse').style.getPropertyValue('width')).toBe('100px') }) })
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 change_tracking.test.ts
TS
3.1 KB
2023-09-24 03:36
EDIT
📄 date_helpers.test.ts
TS
6.4 KB
2023-09-24 03:36
EDIT
📄 slide_transition.test.tsx
TSX
2.4 KB
2023-09-24 03:39
EDIT