fix(client): redirect /challenges/** correctly (#65947)

This commit is contained in:
Oliver Eyton-Williams
2026-02-19 04:47:40 +01:00
committed by GitHub
parent 10d160b360
commit e51eca6d18
3 changed files with 4 additions and 7 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import { render } from '@testing-library/react';
import { navigate, withPrefix } from 'gatsby';
import { navigate } from 'gatsby';
import React from 'react';
import { describe, it, expect } from 'vitest';
@@ -7,7 +7,7 @@ import Challenges from './challenges/index';
import ChallengesRedirect from './challenges/[...]';
describe('Challenges', () => {
const learn = withPrefix('/learn');
const learn = '/learn';
it('should handle redirect to /learn', () => {
render(<Challenges />);
+1 -2
View File
@@ -1,10 +1,9 @@
import { withPrefix } from 'gatsby';
import { describe, it, expect } from 'vitest';
import toLearnPath from './to-learn-path';
describe('To learn path utility (toLearnPath)', () => {
const learn = withPrefix('/learn');
const learn = '/learn';
it('should include /learn', () => {
expect(toLearnPath({})).toMatch(`${learn}`);
+1 -3
View File
@@ -1,5 +1,3 @@
import { withPrefix } from 'gatsby';
interface ToLearnPathKwargs {
block?: string;
challenge?: string;
@@ -26,5 +24,5 @@ export default function toLearnPath({
}
return path;
}, withPrefix('/learn'));
}, '/learn');
}