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
9 changes: 9 additions & 0 deletions frontend/src/pages/home/Home.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@
renderWithProviders(<Home />);

expect(screen.getByText("Leaderboards")).toBeInTheDocument();
expect(
screen.getByText(/GPU MODE's mission is to make high-performance/i),
).toBeInTheDocument();
expect(screen.getByText(/Core Automation/i)).toBeInTheDocument();
expect(screen.getByText(/Northflank/i)).toBeInTheDocument();
expect(screen.getByRole("link", { name: /reach out/i })).toHaveAttribute(
"href",
"mailto:mark@gpumode.com",
);
expect(screen.getByText("test-leaderboard")).toBeInTheDocument();
expect(screen.getByText("T4, L4")).toBeInTheDocument();
expect(screen.getByText("alice")).toBeInTheDocument();
Expand Down Expand Up @@ -694,7 +703,7 @@

renderWithProviders(<Home />);

const link = screen.getByRole("link");

Check failure on line 706 in frontend/src/pages/home/Home.test.tsx

View workflow job for this annotation

GitHub Actions / test

src/pages/home/Home.test.tsx > Home > LeaderboardTile functionality > creates correct navigation links

TestingLibraryElementError: Found multiple elements with the role "link" Here are the matching elements: Ignored nodes: comments, script, style <a class="MuiBox-root css-1przh69" href="mailto:mark@gpumode.com" > reach out </a> Ignored nodes: comments, script, style <a class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 MuiCard-root css-113j9t3-MuiPaper-root-MuiCard-root" data-discover="true" href="/leaderboard/42" style="--Paper-shadow: 0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12);" > <div class="MuiCardContent-root css-1p4602r-MuiCardContent-root" > <div class="MuiBox-root css-1etu1ox" > <h3 class="MuiTypography-root MuiTypography-h6 css-i8lmsl-MuiTypography-root" > <div class="MuiBox-root css-3n403j" /> test-leaderboard </h3> </div> <p class="MuiTypography-root MuiTypography-body2 css-1kh5lox-MuiTypography-root" > T4 </p> <div class="MuiBox-root css-8xl60i" > <div class="MuiBox-root css-85t6ji" > <div class="MuiChip-root MuiChip-filled MuiChip-sizeSmall MuiChip-colorDefault MuiChip-filledDefault css-xq0mjf-MuiChip-root" > <span class="MuiChip-label MuiChip-labelSmall css-eccknh-MuiChip-label" > T4 </span> </div> </div> <div class="MuiBox-root css-0" > <div class="MuiBox-root css-a4p8pb" > <div class="MuiBox-root css-171onha" > <p class="MuiTypography-root MuiTypography-body2 css-rx37n6-MuiTypography-root" > alice </p> <span class="MuiTypography-root MuiTypography-body1 css-6orwfa-MuiTypography-root" /> </div> <p class="MuiTypography-root MuiTypography-body2 css-6ed5ix-MuiTypography-root" > 123.000μs </p> </div> </div> </div> </div> </a> (If this is intentional, then use the `*AllBy*` variant of the query (like `queryAllByText`, `getAllByText`, or `findAllByText`)). Ignored nodes: comments, script, style <body> <div> <div class="MuiBox-root css-1hzmvx4" > <div class="MuiBox-root css-0" > <div class="MuiBox-root css-vj24u7" > <p class="MuiTypography-root MuiTypography-body2 css-kfr8lm-MuiTypography-root" > GPU MODE's mission is to make high-performance GPU programming more accessible. <br /> We rely on donations and sponsorships to fund community compute, lectures, kernel competitions, working groups, and events. <br /> Thank you to Modal, Core Automation, and Northflank for supporting us. To sponsor GPU MODE, please <a class="MuiBox-root css-1przh69" href="mailto:mark@gpumode.com" > reach out </a> . </p> </div> <h1 class="MuiTypography-root MuiTypography-h1 css-1kn8utt-MuiTypography-root" > Leaderboards </h1> <div class="MuiBox-root css-0" > <div class="MuiBox-root css-10ib5jr" > <div class="MuiBox-root css-1c7t5wv" > <h2 class="MuiTypography-root MuiTypography-h5 css-1cfp345-MuiTypography-root" > Active Competitions </h2> <button class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeSmall MuiButton-outlinedSizeSmall MuiButton-colorPrimary MuiButton-disableElevation MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeSmall MuiButton-outlinedSizeSmall Mui
expect(link).toHaveAttribute("href", "/leaderboard/42");
});

Expand Down
35 changes: 35 additions & 0 deletions frontend/src/pages/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,41 @@ export default function Home() {
return (
<ConstrainedContainer>
<Box>
<Box
sx={{
border: 1,
borderColor: "divider",
borderRadius: 1,
bgcolor: "background.paper",
px: 2,
py: 1.5,
width: "100%",
mb: 3,
}}
>
<Typography
variant="body2"
color="text.secondary"
sx={{ lineHeight: 1.6 }}
>
GPU MODE&apos;s mission is to make high-performance GPU programming
more accessible.
<br />
We rely on donations and sponsorships to fund community compute,
lectures, kernel competitions, working groups, and events.
<br />
Thank you to Modal, Core Automation, and Northflank for supporting
us. To sponsor GPU MODE, please{" "}
<Box
component="a"
href="mailto:mark@gpumode.com"
sx={{ color: "primary.main", fontWeight: 600 }}
>
reach out
</Box>
.
</Typography>
</Box>
<Typography variant="h1" component="h1" sx={{ mb: 3 }}>
Leaderboards
</Typography>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/lectures/Lectures.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Box, Typography, Link, Chip } from "@mui/material";
import type { Theme } from "@mui/material/styles";
import { useEffect, useState } from "react";
import { fetchEvents, DiscordEvent } from "../../api/api";
import { fetchEvents } from "../../api/api";
import type { DiscordEvent } from "../../api/api";
import Loading from "../../components/common/loading";

const styles = {
Expand Down
14 changes: 14 additions & 0 deletions frontend/src/tests/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ import { afterEach } from "vitest";
import { cleanup } from "@testing-library/react";
import "@testing-library/jest-dom/vitest";

Object.defineProperty(window, "matchMedia", {
writable: true,
value: (query: string) => ({
matches: false,
media: query,
onchange: null,
addListener: () => {},
removeListener: () => {},
addEventListener: () => {},
removeEventListener: () => {},
dispatchEvent: () => false,
}),
});

// runs a clean after each test case (e.g. clearing jsdom)
afterEach(() => {
cleanup();
Expand Down
Loading