Skip to content

Commit

Permalink
test: remove summary detail tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSisb committed Jan 26, 2024
1 parent 9eed5ac commit 1c25d2e
Showing 1 changed file with 0 additions and 114 deletions.
114 changes: 0 additions & 114 deletions packages/paste-core/components/summary-detail/__tests__/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,118 +155,4 @@ describe("SummaryDetail", () => {
});
});
});

describe("Customization", () => {
it("should set an element data attribute for SummaryDetail components", () => {
render(
<Theme.Provider theme="default">
<MockDefaultElementSummaryDetail />
</Theme.Provider>,
);

const renderedSummaryDetailHeading = screen.getByTestId("summary-detail-heading");
const renderedSummaryDetail = screen.getByTestId("summary-detail");
const renderedSummaryDetailContent = screen.getByTestId("summary-detail-content");
const renderedSummaryDetailHeadingContent = screen.getByTestId("summary-detail-heading-content");
const renderedSummaryDetailToggleButton = screen.getByTestId("summary-detail-toggle-button");

expect(renderedSummaryDetail.getAttribute("data-paste-element")).toEqual("SUMMARY_DETAIL");
expect(renderedSummaryDetailHeading.getAttribute("data-paste-element")).toEqual("SUMMARY_DETAIL_HEADING");
expect(renderedSummaryDetailContent.getAttribute("data-paste-element")).toEqual("SUMMARY_DETAIL_CONTENT");
expect(renderedSummaryDetailHeadingContent.getAttribute("data-paste-element")).toEqual(
"SUMMARY_DETAIL_HEADING_CONTENT",
);
expect(renderedSummaryDetailToggleButton.getAttribute("data-paste-element")).toEqual(
"SUMMARY_DETAIL_TOGGLE_BUTTON",
);
});

it("should set a custom element data attribute for custom named SummaryDetail components", () => {
render(
<Theme.Provider theme="default">
<MockCustomElementSummaryDetail />
</Theme.Provider>,
);

const renderedSummaryDetailHeading = screen.getByTestId("summary-detail-heading");
const renderedSummaryDetail = screen.getByTestId("summary-detail");
const renderedSummaryDetailContent = screen.getByTestId("summary-detail-content");
const renderedSummaryDetailHeadingContent = screen.getByTestId("summary-detail-heading-content");
const renderedSummaryDetailToggleButton = screen.getByTestId("summary-detail-toggle-button");

expect(renderedSummaryDetail.getAttribute("data-paste-element")).toEqual("MY_SUMMARY_DETAIL");
expect(renderedSummaryDetailHeading.getAttribute("data-paste-element")).toEqual("MY_SUMMARY_DETAIL_HEADING");
expect(renderedSummaryDetailContent.getAttribute("data-paste-element")).toEqual("MY_SUMMARY_DETAIL_CONTENT");
expect(renderedSummaryDetailHeadingContent.getAttribute("data-paste-element")).toEqual(
"MY_SUMMARY_DETAIL_HEADING_CONTENT",
);
expect(renderedSummaryDetailToggleButton.getAttribute("data-paste-element")).toEqual(
"MY_SUMMARY_DETAIL_TOGGLE_BUTTON",
);
});

it("should add custom styles to SummaryDetail components", () => {
render(
<CustomizationProvider
baseTheme="default"
theme={TestTheme}
elements={{
SUMMARY_DETAIL: { padding: "space100" },
SUMMARY_DETAIL_CONTENT: { color: "colorTextErrorStrong" },
SUMMARY_DETAIL_HEADING: { color: "colorTextWeakest", backgroundColor: "colorBackgroundDestructiveStrong" },
SUMMARY_DETAIL_HEADING_CONTENT: { color: "colorTextIconError" },
SUMMARY_DETAIL_TOGGLE_BUTTON: { borderColor: "colorBorderError" },
}}
>
<MockDefaultElementSummaryDetail />
</CustomizationProvider>,
);

const renderedSummaryDetailHeading = screen.getByTestId("summary-detail-heading");
const renderedSummaryDetail = screen.getByTestId("summary-detail");
const renderedSummaryDetailContent = screen.getByTestId("summary-detail-content");
const renderedSummaryDetailHeadingContent = screen.getByTestId("summary-detail-heading-content");
const renderedSummaryDetailToggleButton = screen.getByTestId("summary-detail-toggle-button");

expect(renderedSummaryDetail).toHaveStyleRule("padding", "2.25rem");
expect(renderedSummaryDetailHeading).toHaveStyleRule("color", "rgb(255, 255, 255)");
expect(renderedSummaryDetailHeading).toHaveStyleRule("background-color", "rgb(117, 12, 12)");
expect(renderedSummaryDetailContent).toHaveStyleRule("color", "rgb(173, 17, 17)");
expect(renderedSummaryDetailHeadingContent).toHaveStyleRule("color", "rgb(214, 31, 31)");
expect(renderedSummaryDetailToggleButton).toHaveStyleRule("border-color", "rgb(214, 31, 31)");
});

it("should add custom styles to custom named SummaryDetail components", () => {
render(
<CustomizationProvider
baseTheme="default"
theme={TestTheme}
elements={{
MY_SUMMARY_DETAIL: { padding: "space100" },
MY_SUMMARY_DETAIL_CONTENT: { color: "colorTextErrorStrong" },
MY_SUMMARY_DETAIL_HEADING: {
color: "colorTextWeakest",
backgroundColor: "colorBackgroundDestructiveStrong",
},
MY_SUMMARY_DETAIL_HEADING_CONTENT: { color: "colorTextIconError" },
MY_SUMMARY_DETAIL_TOGGLE_BUTTON: { borderColor: "colorBorderError" },
}}
>
<MockCustomElementSummaryDetail />
</CustomizationProvider>,
);
const renderedSummaryDetailHeading = screen.getByTestId("summary-detail-heading");
const renderedSummaryDetail = screen.getByTestId("summary-detail");
const renderedSummaryDetailContent = screen.getByTestId("summary-detail-content");
const renderedSummaryDetailHeadingContent = screen.getByTestId("summary-detail-heading-content");
const renderedSummaryDetailToggleButton = screen.getByTestId("summary-detail-toggle-button");

expect(renderedSummaryDetail).toHaveStyleRule("padding", "2.25rem");
expect(renderedSummaryDetailHeading).toHaveStyleRule("color", "rgb(255, 255, 255)");
expect(renderedSummaryDetailHeading).toHaveStyleRule("background-color", "rgb(117, 12, 12)");
expect(renderedSummaryDetailContent).toHaveStyleRule("color", "rgb(173, 17, 17)");
expect(renderedSummaryDetailHeadingContent).toHaveStyleRule("color", "rgb(214, 31, 31)");
expect(renderedSummaryDetailToggleButton).toHaveStyleRule("border-color", "rgb(214, 31, 31)");
});
});
});

0 comments on commit 1c25d2e

Please sign in to comment.