-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gatsby): ignore case option in create redirect (#29742)
* Add ignoreCase option for createRedirect and support it in client side navigation * Add typings for ignoreCase * Update packages/gatsby/src/redux/actions/public.js Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com> * Prepare lowercased redirects at build time * Add tests * Remove only * Switch to O(1) Maps * Update navigate as well * Update packages/gatsby/index.d.ts Co-authored-by: Ward Peeters <ward@coding-tech.com> * Update packages/gatsby/cache-dir/navigation.js Co-authored-by: Ward Peeters <ward@coding-tech.com> * Set ignoreCase to false by default * Update snapshot * toLowerCase not toLowercase fml Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com> Co-authored-by: Ward Peeters <ward@coding-tech.com>
- Loading branch information
1 parent
662fe41
commit 91b9d66
Showing
9 changed files
with
88 additions
and
60 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
e2e-tests/production-runtime/cypress/integration/redirects.js
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,12 @@ | ||
describe(`Redirects`, () => { | ||
it(`are case insensitive when ignoreCase is set to true`, () => { | ||
cy.visit(`/Longue-PAGE`, { failOnStatusCode: false }).waitForRouteChange() | ||
|
||
cy.get(`h1`).invoke(`text`).should(`contain`, `Hi from the long page`) | ||
}) | ||
it(`are case sensitive when ignoreCase is set to false`, () => { | ||
cy.visit(`/PAGINA-larga`, { failOnStatusCode: false }).waitForRouteChange() | ||
|
||
cy.get(`h1`).invoke(`text`).should(`contain`, `NOT FOUND`) | ||
}) | ||
}) |
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
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
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.