{"size": 797, "ext": "js", "max_stars_repo_path": "lib/tests/routeUtils.test.js", "max_stars_repo_name": "cds-snc/platform-forms-node", "max_stars_repo_stars_event_min_datetime": "2021-01-28T21:27:53.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-16T14:37:24.000Z", "max_issues_repo_path": "lib/tests/routeUtils.test.js", "max_issues_repo_name": "millette/platform-forms-client", "max_issues_repo_issues_event_min_datetime": "2021-01-19T19:32:46.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T18:50:26.000Z", "max_forks_repo_path": "lib/tests/routeUtils.test.js", "max_forks_repo_name": "millette/platform-forms-client", "max_forks_repo_forks_event_min_datetime": "2021-02-22T12:33:19.000Z", "max_forks_repo_forks_event_max_datetime": "2021-06-15T15:23:01.000Z"}
{"max_stars_count": 11, "max_issues_count": 491, "max_forks_count": 3, "avg_line_length": 26.5666666667, "max_line_length": 80, "alphanum_fraction": 0.6223337516}
import { getPageClassNames, getPageNameUrl, isSplashPage } from "../routeUtils";

jest.mock("next/router", () => ({
  useRouter() {
    return {
      route: "/",
      pathname: "",
      query: "",
      asPath: "/",
    };
  },
}));

describe("Test route utils", () => {
  test("Determines whether we're on the splash page", () => {
    const isSplashPageResult = isSplashPage();
    expect(isSplashPageResult).toBe(true);
  });

  test("Checks if the correct pageName is returned for splash page", () => {
    const pageName = getPageNameUrl();
    expect(pageName).toEqual("splash");
  });

  test("Checks if the correct className appears on the splash page", () => {
    const pageClassNames = getPageClassNames();
    expect(pageClassNames).toEqual("outer-container pagesplash");
  });
});
