react-code-dataset / next.js /test /e2e /app-dir /app-catch-all-optional /app-catch-all-optional.test.ts
Download next.js/test/e2e/app-dir/app-catch-all-optional/app-catch-all-optional.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 707 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-catch-all-optional/app-catch-all-optional.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/app-dir/app-catch-all-optional/app-catch-all-optional.test.ts
-
curl -L -o app-catch-all-optional.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/app-dir/app-catch-all-optional/app-catch-all-optional.test.ts
707 Bytes
| import { nextTestSetup } from 'e2e-utils' | |
| describe('app-catch-all-optional', () => { | |
| const { next } = nextTestSetup({ | |
| files: __dirname, | |
| }) | |
| it('should handle optional catchall', async () => { | |
| let $ = await next.render$('/en/flags/the/rest') | |
| expect($('body [data-lang]').text()).toBe('en') | |
| expect($('body [data-flags]').text()).toBe('flags') | |
| expect($('body [data-rest]').text()).toBe('the/rest') | |
| }) | |
| it('should handle optional catchall with no params', async () => { | |
| let $ = await next.render$('/en/flags') | |
| expect($('body [data-lang]').text()).toBe('en') | |
| expect($('body [data-flags]').text()).toBe('flags') | |
| expect($('body [data-rest]').text()).toBe('') | |
| }) | |
| }) | |