mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(client): redirect /challenges/** correctly (#65947)
This commit is contained in:
committed by
GitHub
parent
10d160b360
commit
e51eca6d18
@@ -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,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,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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user