mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-31 15:29:32 +02:00
Fix wrong sitemap for alternate URL (#828)
This commit is contained in:
parent
9c070f020d
commit
3566483aa5
5 changed files with 45 additions and 13 deletions
|
@ -46,4 +46,30 @@ describe('utils', () => {
|
|||
utils.extractBlogPostSummary(blogPostWithoutTruncateContents)
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('getPath', () => {
|
||||
expect(utils.getPath('/docs/en/versioning.html', true)).toBe(
|
||||
'/docs/en/versioning'
|
||||
);
|
||||
expect(utils.getPath('/en/users.html', true)).toBe('/en/users');
|
||||
expect(utils.getPath('/docs/en/asd/index.html', true)).toBe('/docs/en/asd');
|
||||
expect(utils.getPath('/en/help/index.html', true)).toBe('/en/help');
|
||||
expect(utils.getPath('/en/help.a.b.c.d.e.html', true)).toBe(
|
||||
'/en/help.a.b.c.d.e'
|
||||
);
|
||||
expect(utils.getPath('/en/help.js', true)).toBe('/en/help');
|
||||
expect(utils.getPath('/docs/en/versioning.html', false)).toBe(
|
||||
'/docs/en/versioning.html'
|
||||
);
|
||||
expect(utils.getPath('/en/users.html', false)).toBe('/en/users.html');
|
||||
});
|
||||
|
||||
test('removeExtension', () => {
|
||||
expect(utils.removeExtension('/endiliey.html')).toBe('/endiliey');
|
||||
expect(utils.removeExtension('/a.b/')).toBe('/a.b/');
|
||||
expect(utils.removeExtension('/a.b/c.png')).toBe('/a.b/c');
|
||||
expect(utils.removeExtension('/a.b/c.d.e')).toBe('/a.b/c.d');
|
||||
expect(utils.removeExtension('/docs/test')).toBe('/docs/test');
|
||||
expect(utils.removeExtension('pages.js')).toBe('pages');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue