Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TD-1300 Label Chip in Detail Card #803

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: 1 addition & 8 deletions src/Card/DetailCard/DetailCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import DetailCard from "./DetailCard";
import FileCard from "../FileCard/FileCard";
import React from "react";
import { action } from "@storybook/addon-actions";
import userEvent from "@testing-library/user-event";

// a set of default inputs so that tests can change what theyre testing
const defaultInputs = {
Expand Down Expand Up @@ -34,7 +33,7 @@ describe("DetailCard", () => {
});

// test that detail card renders with label that can be clicked
it("renders label and can be clicked", async () => {
it("renders label and can be clicked", () => {
const labels = [
{
_id: "1",
Expand All @@ -55,12 +54,6 @@ describe("DetailCard", () => {
);
// expect label to be in the document
expect(screen.getByText("National Highways")).toBeInTheDocument();
// find the nearest button to the label and click it
await userEvent.click(
screen.getByRole("button", { name: "National Highways" })
);
// expect the mock function to be called
expect(onClickLabel).toHaveBeenCalled();
});

// test that image is rendered in detail card
Expand Down
3 changes: 0 additions & 3 deletions src/Card/DetailCard/DetailCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ function LableStack({
<Fragment>
{labels?.map(label => (
<LabelChip
clickable
color={label.color}
key={label._id}
label={label.name}
Expand All @@ -371,7 +370,6 @@ function LableStack({
<Fragment>
{notOverflowingLabels?.map(label => (
<LabelChip
clickable
color={label.color}
key={label._id}
label={label.name}
Expand Down Expand Up @@ -417,7 +415,6 @@ function LableStack({
if (!notOverflowingLabels?.includes(label)) {
return (
<LabelChip
clickable
key={label._id}
label={label.name}
color={label.color}
Expand Down