Skip to content

Commit

Permalink
Merge pull request #34 from NYPL/NO_REF/nextjs-page-routing
Browse files Browse the repository at this point in the history
Removing nextjs config for page routing
  • Loading branch information
EdwinGuzman authored Oct 13, 2023
2 parents c9cc876 + 8732124 commit 0a5cf47
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pages/404/404.test.tsx → __test__/pages/404/404.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react"
import { render, screen } from "@testing-library/react"

import Custom404 from "."
import Redirect404 from "./redirect"
import { LEGACY_CATALOG_URL } from "../../src/config/constants"
import Custom404 from "../../../pages/404/index"
import Redirect404 from "../../../pages/404/redirect"
import { LEGACY_CATALOG_URL } from "../../../src/config/constants"

describe("404", () => {
it("should display 404 text", () => {
Expand Down
2 changes: 1 addition & 1 deletion pages/Home.test.tsx → __test__/pages/Home.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import { render, screen } from "@testing-library/react"

import Home from "./index"
import Home from "../../pages/index"

describe("Home", () => {
it("should render an H2", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { fireEvent, render, screen, act } from "@testing-library/react"
import mockRouter from "next-router-mock"
import userEvent from "@testing-library/user-event"

import AdvancedSearch from "./advanced"
import AdvancedSearch from "../../../pages/search/advanced"

// Mock next router
jest.mock("next/router", () => jest.requireActual("next-router-mock"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { render, screen } from "@testing-library/react"

import mockRouter from "next-router-mock"

import { results } from "../../__test__/fixtures/searchResultsManyBibs"
import { noBibs } from "../../__test__/fixtures/searchResultsNoBibs"
import SearchResults from "./index"
import { results } from "../../fixtures/searchResultsManyBibs"
import { noBibs } from "../../fixtures/searchResultsNoBibs"
import SearchResults from "../../../pages/search/index"

jest.mock("next/router", () => jest.requireActual("next-router-mock"))

Expand Down
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const nextConfig = {
reactStrictMode: true,
basePath: "/research/research-catalog",
pageExtensions: ["page.tsx", "page.ts", "page.jsx", "page.js"],
// pageExtensions: ["page.tsx", "page.ts", "page.jsx", "page.js"],
}

module.exports = nextConfig

0 comments on commit 0a5cf47

Please sign in to comment.