Skip to content

Commit

Permalink
test(routeselector): remove old check + fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
seaerchin committed Mar 21, 2024
1 parent 13e0a71 commit 2721001
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/__tests__/RouteSelector.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ describe("Tests for RouteSelector", () => {
render(
<MemoryRouter
initialEntries={[
"/sites/site-name/resourceRoom/my-resource/resourceCategory/my-category/editPage/my-file",
"/sites/site-name/resourceRoom/my-resource/resourceCategory/my-category/editPage/my-file.md",
]}
>
<LoggedInContextProvider>
Expand Down Expand Up @@ -518,7 +518,7 @@ describe("Tests for RouteSelector", () => {
test("Should render EditPage page for site site-name if logged in", () => {
// Act
render(
<MemoryRouter initialEntries={["/sites/site-name/editPage/my-file"]}>
<MemoryRouter initialEntries={["/sites/site-name/editPage/my-file.md"]}>
<LoggedInContextProvider>
<RouteSelector />
</LoggedInContextProvider>
Expand Down Expand Up @@ -656,7 +656,7 @@ describe("Tests for RouteSelector", () => {
render(
<MemoryRouter
initialEntries={[
"/sites/site-name/folders/my-folder/editPage/my-file",
"/sites/site-name/folders/my-folder/editPage/my-file.md",
]}
>
<LoggedInContextProvider>
Expand Down Expand Up @@ -693,7 +693,7 @@ describe("Tests for RouteSelector", () => {
render(
<MemoryRouter
initialEntries={[
"/sites/site-name/folders/my-folder/subfolders/my%20subfolder/editPage/my-file",
"/sites/site-name/folders/my-folder/subfolders/my%20subfolder/editPage/my-file.md",
]}
>
<LoggedInContextProvider>
Expand Down
5 changes: 1 addition & 4 deletions src/routing/RouteSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ export const RouteSelector = () => {
fileName: (value) => {
const encodedName = value.split(".").slice(0, -1).join(".")
const decodedName = decodeURIComponent(encodedName)
return (
value === "terms-of-use.md" ||
ALLOWED_CHARACTERS_REGEX.test(decodedName)
)
return ALLOWED_CHARACTERS_REGEX.test(decodedName)
},
subCollectionName: (value) => {
return ALLOWED_CHARACTERS_REGEX.test(decodeURIComponent(value))
Expand Down

0 comments on commit 2721001

Please sign in to comment.