Download wp-calypso/client/components/auto-direction/test/auto-direction.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 769 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/auto-direction/test/auto-direction.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/components/auto-direction/test/auto-direction.jsx
-
curl -L -o auto-direction.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/auto-direction/test/auto-direction.jsx
769 Bytes
| /** | |
| * @jest-environment jsdom | |
| */ | |
| import { render, screen } from '@testing-library/react'; | |
| import AutoDirection from '..'; | |
| describe( 'AutoDirection', () => { | |
| describe( 'component rendering', () => { | |
| test( 'adds a direction to RTL text', () => { | |
| render( | |
| <AutoDirection> | |
| <div data-testid="direction-test">השנה היא 2017.</div> | |
| </AutoDirection> | |
| ); | |
| expect( screen.getByTestId( 'direction-test' ).getAttribute( 'direction' ) ).toEqual( 'rtl' ); | |
| } ); | |
| test( "doesn't add a direction to LTR text", () => { | |
| render( | |
| <AutoDirection> | |
| <div data-testid="direction-test">The year is 2017.</div> | |
| </AutoDirection> | |
| ); | |
| expect( screen.getByTestId( 'direction-test' ).getAttribute( 'direction' ) ).toBeNull(); | |
| } ); | |
| } ); | |
| } ); | |