Spaces:
Sleeping
Sleeping
Download src/utils/Helpers.test.ts from bradduy/edtechdemo: direct link, hf CLI and curl.
- Browser
- Download file 582 Bytes
-
https://huggingface.co/spaces/bradduy/edtechdemo/resolve/main/src/utils/Helpers.test.ts
- Command line
-
hf download hf://spaces/bradduy/edtechdemo/src/utils/Helpers.test.ts
-
curl -L -o Helpers.test.ts https://huggingface.co/spaces/bradduy/edtechdemo/resolve/main/src/utils/Helpers.test.ts
582 Bytes
| import { routing } from '@/libs/i18nNavigation'; | |
| import { getI18nPath } from './Helpers'; | |
| describe('Helpers', () => { | |
| describe('getI18nPath function', () => { | |
| it('should not change the path for default language', () => { | |
| const url = '/random-url'; | |
| const locale = routing.defaultLocale; | |
| expect(getI18nPath(url, locale)).toBe(url); | |
| }); | |
| it('should prepend the locale to the path for non-default language', () => { | |
| const url = '/random-url'; | |
| const locale = 'fr'; | |
| expect(getI18nPath(url, locale)).toMatch(/^\/fr/); | |
| }); | |
| }); | |
| }); | |