mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-12 09:34:01 +01:00
test(i18n): keep Polish-prefixed links unchanged in rewriteLinks
Cover the regression hinted at in review: an already /pl/-prefixed link must not be prefixed a second time now that pl is part of the language pattern.
This commit is contained in:
1 parent
edd824e1e3
commit
3c7eb141fc
1 file changed
+4
-1
@@ -201,12 +201,15 @@ describe('rewriteLinks', () => {
|
||||
it('prefixes links on Polish pages and leaves language links alone', () => {
|
||||
at('/pl/merge-pdf');
|
||||
document.body.innerHTML =
|
||||
'<a href="/tools">tools</a><a href="/de/merge-pdf">de</a>';
|
||||
'<a href="/tools">tools</a>' +
|
||||
'<a href="/de/merge-pdf">de</a>' +
|
||||
'<a href="/pl/merge-pdf">pl</a>';
|
||||
|
||||
rewriteLinks();
|
||||
|
||||
const links = document.querySelectorAll('a');
|
||||
expect(links[0].getAttribute('href')).toBe('/pl/tools');
|
||||
expect(links[1].getAttribute('href')).toBe('/de/merge-pdf');
|
||||
expect(links[2].getAttribute('href')).toBe('/pl/merge-pdf');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user