From d06be1a86436df6afbf61b7a7c0f0de56aa1f2f2 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Fri, 29 Dec 2023 10:12:50 -0800 Subject: [PATCH] fix: correct imports --- __tests__/search-filters.test.ts | 12 ++++++------ components/{footer.tsx => Footer.tsx} | 0 components/{header.tsx => Header.tsx} | 0 components/search/Blurb.tsx | 2 +- components/search/FilterComponents.tsx | 2 +- components/search/Filters.tsx | 4 ++-- components/search/Search.tsx | 6 +++--- components/search/SearchResults.tsx | 4 ++-- components/search/filter-utils.ts | 7 ++----- 9 files changed, 17 insertions(+), 20 deletions(-) rename components/{footer.tsx => Footer.tsx} (100%) rename components/{header.tsx => Header.tsx} (100%) diff --git a/__tests__/search-filters.test.ts b/__tests__/search-filters.test.ts index fbe1ca1..58934fa 100644 --- a/__tests__/search-filters.test.ts +++ b/__tests__/search-filters.test.ts @@ -1,4 +1,4 @@ -import { FilterValues } from "@/components/search/search"; +import { FilterValues } from "@/components/search/Search"; import { endsBefore, filterData, @@ -81,7 +81,7 @@ const defaultFilterValues: FilterValues = { enrollment: [false], available: [false], start: "2023-12-20", - end: undefined, + end: "", institution: "Any Institution", min: 0, max: 20, @@ -192,8 +192,8 @@ describe("Search Filters", () => { }); describe("Filter Utils' Time Utilities", () => { - test("startsAfter undefined", async () => { - const result = startsAfter(undefined, data.courses[0]); + test("startsAfter none", async () => { + const result = startsAfter("", data.courses[0]); expect(result).toBe(true); }); @@ -207,8 +207,8 @@ describe("Filter Utils' Time Utilities", () => { expect(result).toBe(false); }); - test("endsBefore undefined", async () => { - const result = endsBefore(undefined, data.courses[0]); + test("endsBefore none", async () => { + const result = endsBefore("", data.courses[0]); expect(result).toBe(true); }); diff --git a/components/footer.tsx b/components/Footer.tsx similarity index 100% rename from components/footer.tsx rename to components/Footer.tsx diff --git a/components/header.tsx b/components/Header.tsx similarity index 100% rename from components/header.tsx rename to components/Header.tsx diff --git a/components/search/Blurb.tsx b/components/search/Blurb.tsx index f7f8ce7..0c16f2b 100644 --- a/components/search/Blurb.tsx +++ b/components/search/Blurb.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { CollegeObject, FilterValues } from "./search"; +import { CollegeObject, FilterValues } from "./Search"; interface BlurbProps { filterData: ( diff --git a/components/search/FilterComponents.tsx b/components/search/FilterComponents.tsx index 909d82d..9b9819c 100644 --- a/components/search/FilterComponents.tsx +++ b/components/search/FilterComponents.tsx @@ -2,7 +2,7 @@ import React, { ChangeEvent, Dispatch, SetStateAction, useState } from "react"; import { FaCheck, FaChevronDown } from "react-icons/fa"; -import { CollegeObject } from "./search"; +import { CollegeObject } from "./Search"; interface FilterCheckboxProps { title: string; diff --git a/components/search/Filters.tsx b/components/search/Filters.tsx index 4ab0db7..4f0ec75 100644 --- a/components/search/Filters.tsx +++ b/components/search/Filters.tsx @@ -4,9 +4,9 @@ import { CustomFilterCheckbox, InstitutionDropdown, UnitsFilter, -} from "./filterComponents"; +} from "./FilterComponents"; import { FaCircleXmark } from "react-icons/fa6"; -import { CollegeObject, FilterValues } from "./search"; +import { CollegeObject, FilterValues } from "./Search"; interface SearchFilterProps { handleClick: () => void; diff --git a/components/search/Search.tsx b/components/search/Search.tsx index 8f92fd1..bd0deb4 100644 --- a/components/search/Search.tsx +++ b/components/search/Search.tsx @@ -2,12 +2,12 @@ import React, { useEffect, useState } from "react"; import { DropdownComponentSearch } from "../DropdownComponent"; -import { SortDropdown } from "./filterComponents"; +import { SortDropdown } from "./FilterComponents"; import { useRouter, useSearchParams } from "next/navigation"; import { queryDatabase } from "./query-db"; -import SearchResults from "./searchResults"; +import SearchResults from "./SearchResults"; import { FaFilter } from "react-icons/fa6"; -import { SearchFilterPage, SearchFilters } from "./filters"; +import { SearchFilterPage, SearchFilters } from "./Filters"; import SearchBlurb from "./Blurb"; import { filterData } from "./filter-utils"; import { UNIVERSITY_GE } from "@/lib/constants"; diff --git a/components/search/SearchResults.tsx b/components/search/SearchResults.tsx index bcd55c1..ce1509b 100644 --- a/components/search/SearchResults.tsx +++ b/components/search/SearchResults.tsx @@ -1,7 +1,7 @@ import LazyLoad from "react-lazy-load"; import { FaUpRightFromSquare } from "react-icons/fa6"; -import { CollegeObject } from "./search"; -import Tags from "./tags"; +import { CollegeObject } from "./Search"; +import Tags from "./Tags"; interface SearchResultsProps { results: CollegeObject[]; diff --git a/components/search/filter-utils.ts b/components/search/filter-utils.ts index b08c750..c67dbbc 100644 --- a/components/search/filter-utils.ts +++ b/components/search/filter-utils.ts @@ -1,9 +1,6 @@ -import { CollegeObject, FilterValues } from "./search"; +import { CollegeObject, FilterValues } from "./Search"; -export const startsAfter = ( - start: string | undefined, - result: CollegeObject, -) => { +export const startsAfter = (start: string, result: CollegeObject) => { if (start == undefined) return true; return (