Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions cypress.config.js → cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/// <reference types="cypress" />

import fs from "fs";
import path from "path";

const filePlugin = (on, config) => {
const filePlugin = (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => {
on("task", {
getMagicLink({ email }) {
getMagicLink({ email }: { email: string }) {
// Convert email to safe filename
const safeEmail = email.replace(/[@.]/g, "_");
const tempDir = path.join(process.cwd(), ".cypress-temp");
Expand All @@ -23,7 +25,7 @@ const filePlugin = (on, config) => {

return magicLink;
} catch (error) {
throw new Error(`Error reading magic link for ${email}: ${error.message}`);
throw new Error(`Error reading magic link for ${email}: ${(error as Error).message}`);
}
},

Expand Down Expand Up @@ -51,7 +53,7 @@ const filePlugin = (on, config) => {
const config = {
e2e: {
supportFile: "./cypress/support/e2e.ts",
setupNodeEvents(on, config) {
setupNodeEvents(on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) {
return filePlugin(on, config);
},
baseUrl: "http://localhost:3000",
Expand All @@ -60,7 +62,7 @@ const config = {
TEST_EMAIL: process.env.CYPRESS_TEST_EMAIL || "[email protected]",
},
chromeWebSecurity: false,
specPattern: "./cypress/**/*.cy.js",
specPattern: "./cypress/**/*.cy.ts",
},
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference types="cypress" />

/**
* The Experience section is a complex section that allows users to add, edit, and delete companies
* and positions within those companies. It also allows users to add projects to positions.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference types="cypress" />

import getParsedResumeAiResponse from "./data/getParsedResumeAiResponse.json";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference types="cypress" />

/**
* The Profile section is a simple section that allows users to edit their personal information
* including their name, slug, email, title, location, site title, and site description.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference types="cypress" />

/**
* The Skills section is a simple section that allows users to add, edit, and delete skills.
*/
Expand Down
1 change: 1 addition & 0 deletions cypress/integration/navigation/pdfWorkerSpec.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// <reference types="cypress" />

import { expect } from "chai";

/**
Expand Down
22 changes: 22 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "1.1.6",
"description": "Uniform standard for resume data.",
"private": true,
"type": "module",
"keywords": [
"resume"
],
Expand Down Expand Up @@ -91,8 +90,10 @@
"@types/react": "^19.1.8",
"@types/react-color": "^3.0.13",
"@types/react-dom": "^19.1.6",
"@types/testing-library__jest-dom": "^5.14.9",
"@typescript-eslint/parser": "^8.38.0",
"babel-jest": "^30.0.1",
"chai": "^6.0.1",
"cypress": "^14.5.0",
"eslint": "^9",
"eslint-config-next": "^15.3.4",
Expand Down
2 changes: 1 addition & 1 deletion src/app/about/privacy-policy/page.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "@testing-library/jest-dom";
import React from "react";
import { render } from "@testing-library/react";
import PrivacyPolicy from "./page";
import { expect } from "@jest/globals";

describe("PrivacyPolicy Page", () => {
it("matches snapshot", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/about/terms-of-service/page.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "@testing-library/jest-dom";
import React from "react";
import { render } from "@testing-library/react";
import TermsOfService from "./page";
import { expect } from "@jest/globals";

describe("TermsOfService Page", () => {
it("matches snapshot", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/Footer.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import "@testing-library/jest-dom";
import React from "react";
import { usePathname } from "next/navigation";
import { render } from "@testing-library/react";
import { Footer } from "./Footer";
import { expect } from "@jest/globals";

jest.mock("next/navigation");

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/Header.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import "@testing-library/jest-dom";
import { useSession } from "next-auth/react";
import React from "react";
import { render } from "@testing-library/react";
import { Header } from "./Header";
import { expect } from "@jest/globals";

jest.mock("next-auth/react");

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/Layout.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import "@testing-library/jest-dom";
import { useSession } from "next-auth/react";
import React from "react";
import { usePathname } from "next/navigation";
import { render } from "@testing-library/react";
import { Layout } from "./Layout";
import { expect } from "@jest/globals";

jest.mock("next-auth/react");
jest.mock("next/navigation");
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/NavPrimary.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import "@testing-library/jest-dom";
import { useSession } from "next-auth/react";
import React from "react";
import { render } from "@testing-library/react";
import { NavPrimary } from "./NavPrimary";
import { expect } from "@jest/globals";

jest.mock("next-auth/react", () => ({
// Preserve other exports
Expand Down
1 change: 1 addition & 0 deletions src/app/components/ThemeAppearanceToggle.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { usePathname } from "next/navigation";
import { fireEvent, render } from "@testing-library/react";
import { ThemeAppearanceToggle } from "./ThemeAppearanceToggle";
import { ThemeAppearanceContext } from "./ThemeContext";
import { expect } from "@jest/globals";

jest.mock("next/navigation");
jest.mock("@/hooks/useIsDesktop", () => ({
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/ThemeContext.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import "@testing-library/jest-dom";
import React, { useContext } from "react";
import { useContext } from "react";
import { render } from "@testing-library/react";
import { ThemeAppearanceContext, ThemeAppearanceProvider } from "./ThemeContext";
import { expect } from "@jest/globals";

function TestChild() {
const { themeAppearance } = useContext(ThemeAppearanceContext);
Expand Down
1 change: 1 addition & 0 deletions src/app/demo/[themeName]/PDFView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { fireEvent, render, screen } from "@testing-library/react";
import html2pdf from "html2pdf.js";
import { themeDefaultSampleData } from "@/theme/sampleData";
import { PDFView } from "./PDFView";
import { expect } from "@jest/globals";

// Mock html2pdf
jest.mock("html2pdf.js", () => ({
Expand Down
1 change: 1 addition & 0 deletions src/app/demo/[themeName]/ResumeView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { render, screen } from "@testing-library/react";
import { ThemeAppearanceContext } from "@/app/components/ThemeContext";
import { themeDefaultSampleData } from "@/theme/sampleData";
import { ResumeView } from "./ResumeView";
import { expect } from "@jest/globals";

// Mock the ThemeDefault component
jest.mock("@/theme", () => ({
Expand Down
1 change: 1 addition & 0 deletions src/app/demo/[themeName]/page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { titleSuffix } from "@/constants";
import { themeDefinitions } from "@/theme";
import { ThemeName } from "@/types";
import Page, { generateMetadata } from "./page";
import { expect } from "@jest/globals";

// Mock the ResumeView component since we're only testing the page component
jest.mock("./ResumeView", () => ({
Expand Down
1 change: 1 addition & 0 deletions src/app/demo/[themeName]/pdf/page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { titleSuffix } from "@/constants";
import { themeDefinitions } from "@/theme";
import { ThemeName } from "@/types";
import Page, { generateMetadata } from "./page";
import { expect } from "@jest/globals";

// Mock the PDFView component since we don't need to test its implementation
jest.mock("../PDFView", () => ({
Expand Down
2 changes: 1 addition & 1 deletion src/app/edit/components/DeleteWithConfirmation.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "@testing-library/jest-dom";
import React from "react";
import { act, fireEvent, render, waitFor } from "@testing-library/react";
import { DeleteWithConfirmation } from "./DeleteWithConfirmation";
import { expect } from "@jest/globals";

describe("DeleteWithConfirmation", () => {
it("renders correctly with default props", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { act, render } from "@testing-library/react";
import { RichTextEditor } from "./RichTextEditor";
import { expect } from "@jest/globals";

describe("RichTextEditor", () => {
it("renders without crashing", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { TableCellNode, TableNode, TableRowNode } from "@lexical/table";
import { render } from "@testing-library/react";
import { RICH_TEXT_OPTIONS } from "./constants";
import { ToolbarPlugin } from "./ToolbarPlugin";
import { expect } from "@jest/globals";

const initialConfig = {
namespace: "TestEditor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { renderHook } from "@testing-library/react";
import { createEditor, KEY_ENTER_COMMAND, LexicalEditor } from "lexical";
import { RichTextAction } from "@/app/edit/components/RichTextEditor/plugins/constants";
import { useKeyBindings } from "@/app/edit/components/RichTextEditor/useKeyBindings";
import { expect } from "@jest/globals";

describe("useKeyBindings", () => {
let onAction: jest.Mock;
Expand Down
2 changes: 1 addition & 1 deletion src/app/edit/components/SectionTitle.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "@testing-library/jest-dom";
import React from "react";
import { render } from "@testing-library/react";
import { SectionTitle } from "./SectionTitle";
import { expect } from "@jest/globals";

describe("SectionTitle", () => {
it("renders correctly with the provided title", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/edit/components/UpdateWithConfirmation.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "@testing-library/jest-dom";
import React from "react";
import { fireEvent, render, waitFor } from "@testing-library/react";
import { UpdateWithConfirmation } from "./UpdateWithConfirmation";
import { expect } from "@jest/globals";

describe("UpdateWithConfirmation", () => {
it("renders correctly with default props", async () => {
Expand Down
1 change: 1 addition & 0 deletions src/app/edit/education/EditEducation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useSession } from "next-auth/react";
import { render, waitFor } from "@testing-library/react";
import { useQuery } from "@tanstack/react-query";
import { EditEducation } from "./EditEducation";
import { expect } from "@jest/globals";

jest.mock("next-auth/react", () => ({
useSession: jest.fn(),
Expand Down
2 changes: 1 addition & 1 deletion src/app/edit/education/EducationForm.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import "@testing-library/jest-dom";
import React from "react";
import { LocalizationProvider } from "@mui/x-date-pickers";
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
import { fireEvent, render, waitFor } from "@testing-library/react";
import { EducationForm } from "./EducationForm";
import { expect } from "@jest/globals";

describe("EducationForm", () => {
const mockEducation = {
Expand Down
2 changes: 1 addition & 1 deletion src/app/edit/education/EducationItem.test.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import "@testing-library/jest-dom";
import { useSession } from "next-auth/react";
import React from "react";
import { LocalizationProvider } from "@mui/x-date-pickers";
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
import { fireEvent, render, waitFor } from "@testing-library/react";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { updateEducation } from "@/graphql/updateEducation";
import { EducationItem } from "./EducationItem";
import { expect } from "@jest/globals";

jest.mock("next-auth/react", () => ({
useSession: jest.fn(),
Expand Down
2 changes: 1 addition & 1 deletion src/app/edit/import/ExtractedDataContext.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { act, render, screen } from "@testing-library/react";
import { ExtractedDataProvider, useExtractedData } from "./ExtractedDataContext";
import { ParsedResumeData } from "./types";
import { expect } from "@jest/globals";

// Test component that uses the context
const TestComponent = () => {
Expand Down
1 change: 1 addition & 0 deletions src/app/edit/import/education/ExtractedEducation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
import { fireEvent, render, screen } from "@testing-library/react";
import { ExtractedDataProvider } from "../ExtractedDataContext";
import { ExtractedEducation } from "./ExtractedEducation";
import { expect } from "@jest/globals";

// Mock the ExtractedDataContext
jest.mock("../ExtractedDataContext", () => ({
Expand Down
1 change: 1 addition & 0 deletions src/app/edit/profile/components/AccountForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from "react";
import { fireEvent, render, waitFor } from "@testing-library/react";
import { useIsDesktop } from "@/hooks/useIsDesktop";
import { AccountForm } from "./AccountForm";
import { expect } from "@jest/globals";

jest.mock("@/hooks/useIsDesktop", () => ({
useIsDesktop: jest.fn(),
Expand Down
1 change: 1 addition & 0 deletions src/app/edit/profile/components/SocialsForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from "react";
import { render } from "@testing-library/react";
import { useQuery, useQueryClient } from "@tanstack/react-query";
import { SocialsForm } from "./SocialsForm";
import { expect } from "@jest/globals";

jest.mock("next-auth/react", () => ({
useSession: jest.fn(),
Expand Down
2 changes: 1 addition & 1 deletion src/app/edit/profile/components/sections.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "@testing-library/jest-dom";
import React from "react";
import { render } from "@testing-library/react";
import { FieldDescription, FieldTitle, GridSection, InputSection, SectionTitle } from "./sections";
import { expect } from "@jest/globals";

describe("sections components", () => {
it("renders InputSection correctly", () => {
Expand Down
1 change: 1 addition & 0 deletions src/app/edit/profile/page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { getSession } from "@/lib/auth";
import { prisma } from "@/lib/prisma";
import Page from "./page";
import { expect } from "@jest/globals";

jest.mock("next-auth/react", () => ({
useSession: jest.fn(),
Expand Down
1 change: 1 addition & 0 deletions src/app/edit/skills/EditSkills.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useSession } from "next-auth/react";
import { render, waitFor } from "@testing-library/react";
import { useQuery } from "@tanstack/react-query";
import { EditSkills } from "./EditSkills";
import { expect } from "@jest/globals";

jest.mock("next-auth/react", () => ({
useSession: jest.fn(),
Expand Down
1 change: 1 addition & 0 deletions src/app/edit/skills/EditSkillsSearch.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from "react";
import { fireEvent, render, waitFor } from "@testing-library/react";
import { useQuery, useQueryClient } from "@tanstack/react-query";
import { EditSkillsSearch } from "./EditSkillsSearch";
import { expect } from "@jest/globals";

jest.mock("next-auth/react", () => ({
useSession: jest.fn(),
Expand Down
Loading