Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+24
@@ -0,0 +1,24 @@
|
||||
// @vitest-environment jsdom
|
||||
import "@testing-library/jest-dom/vitest";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { StepperHorizontal } from "./StepperHorizontal";
|
||||
|
||||
describe("StepperHorizontal", () => {
|
||||
it("announces progress without implying that static steps are clickable", () => {
|
||||
const { container } = render(
|
||||
<StepperHorizontal aria-label="Setup progress">
|
||||
<StepperHorizontal.Step firstStep variant="completed" stepNumber="1" label="Account" />
|
||||
<StepperHorizontal.Step variant="active" stepNumber="2" label="Payment" />
|
||||
<StepperHorizontal.Step lastStep stepNumber="3" label="Workspace" />
|
||||
</StepperHorizontal>
|
||||
);
|
||||
|
||||
expect(screen.getByRole("list", { name: "Setup progress" })).toBeVisible();
|
||||
expect(screen.getAllByRole("listitem")).toHaveLength(3);
|
||||
expect(screen.getByRole("listitem", { current: "step" })).toHaveTextContent("Payment");
|
||||
expect(container.querySelectorAll(".cursor-pointer")).toHaveLength(0);
|
||||
expect(screen.queryAllByRole("button")).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
+5
-2
@@ -31,9 +31,11 @@ const Step = React.forwardRef<HTMLDivElement, StepProps>(function Step(
|
||||
return (
|
||||
<div
|
||||
className={SubframeUtils.twClassNames(
|
||||
"group/c1145464 flex w-full cursor-pointer flex-col items-center justify-center gap-1",
|
||||
"group/c1145464 flex w-full flex-col items-center justify-center gap-1",
|
||||
className
|
||||
)}
|
||||
role="listitem"
|
||||
aria-current={variant === "active" ? "step" : undefined}
|
||||
ref={ref}
|
||||
{...otherProps}
|
||||
>
|
||||
@@ -74,7 +76,7 @@ const Step = React.forwardRef<HTMLDivElement, StepProps>(function Step(
|
||||
{label ? (
|
||||
<span
|
||||
className={SubframeUtils.twClassNames(
|
||||
"font-['Inter'] text-[14px] font-[400] leading-[20px] text-[#737373] group-hover/c1145464:text-[#171717]",
|
||||
"font-['Inter'] text-[14px] font-[400] leading-[20px] text-[#737373]",
|
||||
{
|
||||
"font-['Inter'] text-[14px] font-[500] leading-[20px] tracking-normal text-[#171717]":
|
||||
variant === "active",
|
||||
@@ -107,6 +109,7 @@ const StepperHorizontalRoot = React.forwardRef<
|
||||
"flex w-full items-start justify-center",
|
||||
className
|
||||
)}
|
||||
role="list"
|
||||
ref={ref}
|
||||
{...otherProps}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user