Skip to content

Commit

Permalink
Remove disable in storybook and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChessyHsu committed Nov 6, 2024
1 parent f90b9cd commit 4105d9e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 27 deletions.
12 changes: 6 additions & 6 deletions packages/syntax-core/src/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,20 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(
{
"data-testid": dataTestId,
text,
loadingText,
// loadingText,
color = "primary",
size = "md",
accessibilityLabel,
disabled = false,
// accessibilityLabel,
// disabled = false,
loading = false,
fullWidth = false,
startIcon: StartIcon,
endIcon: EndIcon,
on = "lightBackground",
onClick,
tooltip,
type = "button",
}: ButtonProps,
}: // tooltip,
// type = "button",
ButtonProps,
ref,
) => {
const isHydrated = useIsHydrated();
Expand Down
6 changes: 3 additions & 3 deletions packages/syntax-core/src/LinkButton/LinkButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ const LinkButton = forwardRef<HTMLAnchorElement, LinkButtonProps>(
(
{
text,
href,
target,
rel,
// href,
// target,
// rel,
"data-testid": dataTestId,
color = "primary",
size = "md",
Expand Down
4 changes: 0 additions & 4 deletions packages/syntax-core/src/LinkTapArea/LinkTapArea.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ export const Default: StoryObj<typeof LinkTapArea> = {
render: ({ ...args }) => <LinkTapArea {...args} />,
};

export const Disabled: StoryObj<typeof Default> = {
args: { ...Default.args, disabled: true },
};

const roundingLookup = {
sm: "8px",
md: "12px",
Expand Down
14 changes: 0 additions & 14 deletions packages/syntax-core/src/LinkTapArea/LinkTapArea.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,6 @@ describe("linkTapArea", () => {
expect(handleTap).toHaveBeenCalledTimes(1);
});

it("does not fire the onClick when clicked and the LinkTapArea is disabled", async () => {
const handleTap = vi.fn();
render(
<LinkTapArea
disabled
data-testid="link-tap-area-testid"
onClick={handleTap}
/>,
);
const linkTapArea = await screen.findByTestId("link-tap-area-testid");
await userEvent.click(linkTapArea);
expect(handleTap).toHaveBeenCalledTimes(0);
});

it("sets an accessibility label", async () => {
render(
<LinkTapArea
Expand Down

0 comments on commit 4105d9e

Please sign in to comment.