-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: issue where canonical was missing trailing slash (#567)
Co-authored-by: Nícholas Oliveira <[email protected]>
- Loading branch information
1 parent
1494a33
commit 232f4e6
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@headstartwp/next": patch | ||
--- | ||
|
||
Fix: only convertUrls if url starts with sourceUrl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { convertUrl } from '../Yoast'; | ||
|
||
describe('convertUrl', () => { | ||
it('root works without trailing slash', () => { | ||
expect( | ||
convertUrl('https://test.com/test', 'https://test.test.com', 'https://test.com/test'), | ||
).toBe('https://test.test.com/'); | ||
}); | ||
|
||
it('root works with trailing slash', () => { | ||
expect( | ||
convertUrl('https://test.com/test/', 'https://test.test.com', 'https://test.com/test'), | ||
).toBe('https://test.test.com/'); | ||
}); | ||
|
||
it('external url returns external url', () => { | ||
expect( | ||
convertUrl( | ||
'https://external.com/test', | ||
'https://test.test.com', | ||
'https://test.com/test', | ||
), | ||
).toBe('https://external.com/test'); | ||
}); | ||
}); |
232f4e6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
headstarwp – ./
headstarwp-git-develop-tenup-internal.vercel.app
headstarwp-tenup-internal.vercel.app
headstartwp.vercel.app