Skip to content

Commit

Permalink
chore: add tests for ScoringType
Browse files Browse the repository at this point in the history
  • Loading branch information
smoak committed Nov 26, 2023
1 parent d039850 commit 85c28b8
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions app/components/ScoringDetail/ScoringType/test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { render, screen } from "@testing-library/react";
import { ScoringType } from ".";

describe("ScoringType", () => {
describe("when rendered with an even strength goal", () => {
let container: HTMLElement;

beforeEach(() => {
container = render(<ScoringType goalType="ev" />).container;
});

it("should render empty", () => {
expect(container).toBeEmptyDOMElement();
});
});

describe("when rendered with a short handed goal", () => {
beforeEach(() => {
render(<ScoringType goalType="sh" />);
});

it("should render `SHG`", () => {
expect(screen.getByText("SHG")).toBeInTheDocument();
});
});

describe("when rendered with a power play goal", () => {
beforeEach(() => {
render(<ScoringType goalType="pp" />);
});

it("should render `PP`", () => {
expect(screen.getByText("PP")).toBeInTheDocument();
});
});

describe("when rendered with a empty net goal", () => {
beforeEach(() => {
render(<ScoringType goalType="en" />);
});

it("should render `EN`", () => {
expect(screen.getByText("EN")).toBeInTheDocument();
});
});
});

1 comment on commit 85c28b8

@vercel
Copy link

@vercel vercel bot commented on 85c28b8 Nov 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nhl-remix – ./

nhl-remix-smoak.vercel.app
nhl-remix.vercel.app
nhl-remix-git-main-smoak.vercel.app

Please sign in to comment.