fix(theme-common): isSamePath should be case-insensitive (#6758)

This commit is contained in:
Sébastien Lorber 2022-02-25 14:58:54 +01:00 committed by GitHub
parent 39b66d82ef
commit 44a65f3337
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 2 deletions

View file

@ -16,6 +16,14 @@ describe('isSamePath', () => {
expect(isSamePath('/docs', '/docs/')).toBeTruthy();
});
test('should be true for compared path with different case', () => {
expect(isSamePath('/doCS', '/DOcs')).toBeTruthy();
});
test('should be true for compared path with different case + trailing slash', () => {
expect(isSamePath('/doCS', '/DOcs/')).toBeTruthy();
});
test('should be false for compared path with double trailing slash', () => {
expect(isSamePath('/docs', '/docs//')).toBeFalsy();
});