Download next.js/test/production/jest/rsc/app/component.test.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 411 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/jest/rsc/app/component.test.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/production/jest/rsc/app/component.test.jsx
-
curl -L -o component.test.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/jest/rsc/app/component.test.jsx
411 Bytes
| /** | |
| * @jest-environment jsdom | |
| */ | |
| import { fireEvent, render, screen } from '@testing-library/react' | |
| import '@testing-library/jest-dom' | |
| import Component from './component' | |
| it('works with client-only code', () => { | |
| render(<Component />) | |
| expect(screen.getByRole('heading')).toHaveTextContent('0') | |
| fireEvent.click(screen.getByRole('button')) | |
| expect(screen.getByRole('heading')).toHaveTextContent('1') | |
| }) | |