mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
26 lines
586 B
TypeScript
26 lines
586 B
TypeScript
import convertLinksToLocale from './convertLinksToLocale';
|
|
|
|
describe('convertLinksToLocale', () => {
|
|
|
|
it('should convert links', async () => {
|
|
const tests: [string, any, string][] = [
|
|
[
|
|
'test [link](/help/link)',
|
|
{ pathPrefix: 'fr' },
|
|
'test [link](/fr/help/link)',
|
|
],
|
|
[
|
|
'test [link](/help/link) [link2](/link2)',
|
|
{ pathPrefix: 'fr' },
|
|
'test [link](/fr/help/link) [link2](/fr/link2)',
|
|
],
|
|
];
|
|
|
|
for (const [input, locale, expected] of tests) {
|
|
const actual = convertLinksToLocale(input, locale);
|
|
expect(actual).toBe(expected);
|
|
}
|
|
});
|
|
|
|
});
|