From fcc53723e987451e8d9f67c15d3e54002213a106 Mon Sep 17 00:00:00 2001 From: Khuram Niaz Date: Fri, 27 Feb 2026 01:10:59 -0700 Subject: [PATCH 1/8] Make button, labels consistant --- __tests__/AddCompany.spec.tsx | 4 +-- __tests__/ProfileContainer.spec.tsx | 6 ++-- e2e/add-job.spec.ts | 14 ++++----- e2e/profile.spec.ts | 30 +++++++++++++++--- src/app/dashboard/automations/[id]/page.tsx | 1 + .../activities/ActivitiesContainer.tsx | 14 ++++++--- src/components/admin/AddCompany.tsx | 2 +- .../automations/AutomationContainer.tsx | 9 ++++-- src/components/dashboard/JobsAppliedCard.tsx | 8 ++--- src/components/myjobs/AddJob.tsx | 2 +- src/components/profile/ProfileContainer.tsx | 6 ++-- src/components/tasks/TasksContainer.tsx | 31 +++++++++++++++---- 12 files changed, 86 insertions(+), 41 deletions(-) diff --git a/__tests__/AddCompany.spec.tsx b/__tests__/AddCompany.spec.tsx index bfa4e0f..9262911 100644 --- a/__tests__/AddCompany.spec.tsx +++ b/__tests__/AddCompany.spec.tsx @@ -27,7 +27,7 @@ describe("AddCompany Component", () => { />, ); expect( - screen.getByRole("button", { name: /add company/i }), + screen.getByRole("button", { name: /new company/i }), ).toBeInTheDocument(); }); @@ -41,7 +41,7 @@ describe("AddCompany Component", () => { />, ); const addCompanyButton = screen.getByRole("button", { - name: /add company/i, + name: /new company/i, }); fireEvent.click(addCompanyButton); diff --git a/__tests__/ProfileContainer.spec.tsx b/__tests__/ProfileContainer.spec.tsx index fa34690..45cf6f5 100644 --- a/__tests__/ProfileContainer.spec.tsx +++ b/__tests__/ProfileContainer.spec.tsx @@ -10,7 +10,7 @@ jest.mock("@/actions/profile.actions", () => ({ total: 0, success: true, message: "", - }) + }), ), })); @@ -31,7 +31,7 @@ describe("ProfileContainer Component", () => { it("should open the create resume dialog upon clicking create resume button", async () => { const createResumeButton = screen.getByRole("button", { - name: /create resume/i, + name: /new resume/i, }); await act(async () => { fireEvent.click(createResumeButton); @@ -39,7 +39,7 @@ describe("ProfileContainer Component", () => { expect(screen.getByRole("dialog")).toBeInTheDocument(); expect( - screen.getByRole("heading", { level: 2, name: /create resume/i }) + screen.getByRole("heading", { level: 2, name: /create resume/i }), ).toBeInTheDocument(); }); }); diff --git a/e2e/add-job.spec.ts b/e2e/add-job.spec.ts index 31f8a4b..b884794 100644 --- a/e2e/add-job.spec.ts +++ b/e2e/add-job.spec.ts @@ -19,7 +19,7 @@ async function createNewJob(page: Page, jobText: string) { const companyText = `company ${suffix}`; const locationText = `location ${suffix}`; - await page.getByRole("button", { name: "Add New Job" }).click(); + await page.getByRole("button", { name: "New Job" }).click(); await expect(page).toHaveURL("/dashboard/myjobs"); await page.getByTestId("add-job-btn").click(); @@ -111,7 +111,7 @@ test.describe("Add New Job", () => { test("should allow me to add a new job", async ({ page }) => { await createNewJob(page, jobText); await expect( - page.getByRole("row", { name: jobText }).first() + page.getByRole("row", { name: jobText }).first(), ).toBeVisible(); await deleteJob(page, jobText); }); @@ -129,16 +129,16 @@ test.describe("Add New Job", () => { .click(); await page.getByRole("menuitem", { name: "Edit Job" }).click(); await expect( - page.getByPlaceholder("Copy and paste job link here") + page.getByPlaceholder("Copy and paste job link here"), ).toHaveValue("www.google.com"); await expect(page.getByLabel("Job Title")).toContainText( - "developer test title" + "developer test title", ); await expect(page.getByLabel("Company")).toContainText( - `company ${jobText.replace(/\s+/g, "-")}` + `company ${jobText.replace(/\s+/g, "-")}`, ); await expect(page.getByLabel("Job Location")).toContainText( - `location ${jobText.replace(/\s+/g, "-")}` + `location ${jobText.replace(/\s+/g, "-")}`, ); await expect(page.getByLabel("Job Source")).toContainText("Indeed"); await expect(page.getByLabel("Select Job Status")).toContainText("Draft"); @@ -150,7 +150,7 @@ test.describe("Add New Job", () => { .fill("test description edited"); await page.getByTestId("save-job-btn").click(); await expect(page.getByRole("status").first()).toContainText( - /Job has been updated/ + /Job has been updated/, ); await deleteJob(page, jobText); }); diff --git a/e2e/profile.spec.ts b/e2e/profile.spec.ts index f56375a..03f6079 100644 --- a/e2e/profile.spec.ts +++ b/e2e/profile.spec.ts @@ -12,7 +12,7 @@ test.beforeEach(async ({ page, baseURL }) => { }); async function createResume(page: Page, title: string) { - await page.getByRole("button", { name: "Create Resume" }).click(); + await page.getByRole("button", { name: "New Resume" }).click(); await page.getByPlaceholder("Ex: Full Stack Developer").fill(title); await page.getByRole("button", { name: "Save" }).click(); } @@ -204,7 +204,12 @@ test.describe("Profile page", () => { await page.getByPlaceholder("Ex: Stanford").click(); await page.getByPlaceholder("Ex: Stanford").fill("test school"); const locationText = "location test"; - await selectOrCreateComboboxOption(page, "Location", "Create or Search location", locationText); + await selectOrCreateComboboxOption( + page, + "Location", + "Create or Search location", + locationText, + ); await expect(page.getByLabel("Location")).toContainText(locationText); await page.getByPlaceholder("Ex: Bachelor's").click(); await page.getByPlaceholder("Ex: Bachelor's").fill("degree text"); @@ -260,13 +265,28 @@ async function addExperience(page: Page, resumeTitle: string, jobText: string) { await sectionTitleField.fill("Experience"); await sectionTitleField.press("Tab"); } - await selectOrCreateComboboxOption(page, "Job Title", "Create or Search title", jobText); + await selectOrCreateComboboxOption( + page, + "Job Title", + "Create or Search title", + jobText, + ); await expect(page.getByLabel("Job Title")).toContainText(jobText); const companyText = "company test"; - await selectOrCreateComboboxOption(page, "Company", "Create or Search company", companyText); + await selectOrCreateComboboxOption( + page, + "Company", + "Create or Search company", + companyText, + ); await expect(page.getByLabel("Company")).toContainText(companyText); const locationText = "location test"; - await selectOrCreateComboboxOption(page, "Job Location", "Create or Search location", locationText); + await selectOrCreateComboboxOption( + page, + "Job Location", + "Create or Search location", + locationText, + ); await expect(page.getByLabel("Job Location")).toContainText(locationText); await page.getByLabel("Start Date").click(); // Wait for calendar popover to open diff --git a/src/app/dashboard/automations/[id]/page.tsx b/src/app/dashboard/automations/[id]/page.tsx index d17d147..2e13082 100644 --- a/src/app/dashboard/automations/[id]/page.tsx +++ b/src/app/dashboard/automations/[id]/page.tsx @@ -233,6 +233,7 @@ export default function AutomationDetailPage() { {automation.status === "active" ? "Pause" : "Resume"} @@ -183,7 +183,11 @@ function ActivitiesContainer() { size="sm" variant="outline" onClick={() => - loadActivities(page + 1, recordsPerPage, searchTerm || undefined) + loadActivities( + page + 1, + recordsPerPage, + searchTerm || undefined, + ) } disabled={loading} className="btn btn-primary" diff --git a/src/components/admin/AddCompany.tsx b/src/components/admin/AddCompany.tsx index e01b572..0b07d46 100644 --- a/src/components/admin/AddCompany.tsx +++ b/src/components/admin/AddCompany.tsx @@ -118,7 +118,7 @@ function AddCompany({ > - Add Company + New Company diff --git a/src/components/automations/AutomationContainer.tsx b/src/components/automations/AutomationContainer.tsx index c9fa8c1..bcfe4c7 100644 --- a/src/components/automations/AutomationContainer.tsx +++ b/src/components/automations/AutomationContainer.tsx @@ -24,7 +24,8 @@ export function AutomationContainer({ resumes }: AutomationContainerProps) { const [automations, setAutomations] = useState([]); const [loading, setLoading] = useState(true); const [wizardOpen, setWizardOpen] = useState(false); - const [editAutomation, setEditAutomation] = useState(null); + const [editAutomation, setEditAutomation] = + useState(null); const loadAutomations = useCallback(async () => { setLoading(true); @@ -71,7 +72,11 @@ export function AutomationContainer({ resumes }: AutomationContainerProps) { - diff --git a/src/components/dashboard/JobsAppliedCard.tsx b/src/components/dashboard/JobsAppliedCard.tsx index 8810eec..7414356 100644 --- a/src/components/dashboard/JobsAppliedCard.tsx +++ b/src/components/dashboard/JobsAppliedCard.tsx @@ -26,18 +26,14 @@ export default function JobsAppliedCard() { onClick={() => router.push("/dashboard/myjobs")} > - - Add New Job - + New Job diff --git a/src/components/myjobs/AddJob.tsx b/src/components/myjobs/AddJob.tsx index 78573c7..ef2a503 100644 --- a/src/components/myjobs/AddJob.tsx +++ b/src/components/myjobs/AddJob.tsx @@ -189,7 +189,7 @@ export function AddJob({ > - Add Job + New Job diff --git a/src/components/profile/ProfileContainer.tsx b/src/components/profile/ProfileContainer.tsx index 41d7baa..2e94ef8 100644 --- a/src/components/profile/ProfileContainer.tsx +++ b/src/components/profile/ProfileContainer.tsx @@ -30,7 +30,7 @@ const ProfileContainer = () => { setLoading(true); const { data, total, success, message } = await getResumeList( page, - recordsPerPage + recordsPerPage, ); if (success && data) { setResumes((prev) => (page === 1 ? data : [...prev, ...data])); @@ -46,7 +46,7 @@ const ProfileContainer = () => { }); } }, - [recordsPerPage] + [recordsPerPage], ); const reloadResumes = useCallback(async () => { @@ -87,7 +87,7 @@ const ProfileContainer = () => { > - Create Resume + New Resume { + async ( + pageNum: number, + filter?: string, + statuses?: TaskStatus[], + search?: string, + ) => { setLoading(true); const { success, data, total, message } = await getTasksList( pageNum, @@ -204,7 +209,8 @@ function TasksContainer({ }; useEffect(() => { - (async () => await loadTasks(1, filterKey, statusFilter, searchTerm || undefined))(); + (async () => + await loadTasks(1, filterKey, statusFilter, searchTerm || undefined))(); // eslint-disable-next-line react-hooks/exhaustive-deps }, [loadTasks, filterKey, statusFilter, recordsPerPage]); @@ -306,12 +312,18 @@ function TasksContainer({ Created Date Due Date Updated Date - Activity Type + + Activity Type + ) : ( - @@ -325,7 +337,7 @@ function TasksContainer({ > - Add Task + New Task @@ -368,7 +380,14 @@ function TasksContainer({