Download wp-calypso/client/blocks/image-editor/test/image-editor-canvas.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 812 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/blocks/image-editor/test/image-editor-canvas.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/blocks/image-editor/test/image-editor-canvas.jsx
-
curl -L -o image-editor-canvas.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/blocks/image-editor/test/image-editor-canvas.jsx
812 Bytes
| /** | |
| * @jest-environment jsdom | |
| */ | |
| import { render, screen } from '@testing-library/react'; | |
| import { ImageEditorCanvas } from '../image-editor-canvas'; | |
| jest.mock( 'calypso/blocks/image-editor/image-editor-crop', () => () => ( | |
| <div data-testid="image-editor-crop-mock" /> | |
| ) ); | |
| describe( 'ImageEditorToolbar', () => { | |
| test( 'should render cropping area when the image meets the minimum height and width', () => { | |
| render( <ImageEditorCanvas isImageLoaded showCrop /> ); | |
| expect( screen.queryByTestId( 'image-editor-crop-mock' ) ).toBeDefined(); | |
| } ); | |
| test( 'should not render cropping area when the image is smaller than the minimum dimensions', () => { | |
| render( <ImageEditorCanvas isImageLoaded showCrop={ false } /> ); | |
| expect( screen.queryByTestId( 'image-editor-crop-mock' ) ).toBeNull(); | |
| } ); | |
| } ); | |