Skip to content

Commit

Permalink
remove course filter from featured carousel (#1164)
Browse files Browse the repository at this point in the history
* remove course filter from featured carousel

* fix homepage tests
  • Loading branch information
gumaerc authored Jun 25, 2024
1 parent 4bff2f5 commit 6a5d2e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions frontends/mit-open/src/pages/HomePage/HomePage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,32 +115,31 @@ describe("Home Page Carousel", () => {
test.each<{ tab: string; params: FeaturedRequest }>([
{
tab: "All",
params: { limit: 12, resource_type: ["course"] },
params: { limit: 12 },
},
{
tab: "Free",
params: { limit: 12, resource_type: ["course"], free: true },
params: { limit: 12, free: true },
},
{
tab: "With Certificate",
params: {
resource_type: ["course"],
limit: 12,
certification: true,
professional: false,
},
},
{
tab: "Professional & Executive Learning",
params: { resource_type: ["course"], limit: 12, professional: true },
params: { limit: 12, professional: true },
},
])("Featured Courses Carousel Tabs", async ({ tab, params }) => {
const resources = learningResources.resources({ count: 12 })
setupAPIs()

// The "All" tab is initially visible, so it needs a response.
setMockResponse.get(
urls.learningResources.featured({ limit: 12, resource_type: ["course"] }),
urls.learningResources.featured({ limit: 12 }),
learningResources.resources({ count: 0 }),
)
// This is for the clicked tab (which might be "All")
Expand Down
1 change: 0 additions & 1 deletion frontends/mit-open/src/pages/HomePage/carousels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { ResourceCarouselProps } from "@/page-components/ResourceCarousel/R
import type { FeaturedApiFeaturedListRequest as FeaturedListParams } from "api"

const FEATURED_COMMON_PARAMS: FeaturedListParams = {
resource_type: ["course"],
limit: 12,
}
const FEATURED_RESOURCES_CAROUSEL: ResourceCarouselProps["config"] = [
Expand Down

0 comments on commit 6a5d2e0

Please sign in to comment.