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

chore(deps): bump the version-all group across 1 directory with 18 updates #6332

Merged
merged 2 commits into from
Jan 17, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { ContextMenuListItem } from "#/components/features/context-menu/context-

describe("ContextMenuListItem", () => {
it("should render the component with the children", () => {
render(<ContextMenuListItem onClick={vi.fn}>Test</ContextMenuListItem>);
const onClickMock = vi.fn();
render(
<ContextMenuListItem onClick={onClickMock}>Test</ContextMenuListItem>,
);

expect(screen.getByTestId("context-menu-list-item")).toBeInTheDocument();
expect(screen.getByText("Test")).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,29 @@ import { describe, it, vi, expect } from "vitest";
import { BaseModal } from "#/components/shared/modals/base-modal/base-modal";

describe("BaseModal", () => {
const onOpenChangeMock = vi.fn();

it("should render if the modal is open", () => {
const { rerender } = render(
<BaseModal isOpen={false} onOpenChange={vi.fn} title="Settings" />,
<BaseModal
isOpen={false}
onOpenChange={onOpenChangeMock}
title="Settings"
/>,
);
expect(screen.queryByText("Settings")).not.toBeInTheDocument();

rerender(<BaseModal title="Settings" onOpenChange={vi.fn} isOpen />);
rerender(
<BaseModal title="Settings" onOpenChange={onOpenChangeMock} isOpen />,
);
expect(screen.getByText("Settings")).toBeInTheDocument();
});

it("should render an optional subtitle", () => {
render(
<BaseModal
isOpen
onOpenChange={vi.fn}
onOpenChange={onOpenChangeMock}
title="Settings"
subtitle="Subtitle"
/>,
Expand All @@ -43,7 +51,7 @@ describe("BaseModal", () => {
render(
<BaseModal
isOpen
onOpenChange={vi.fn}
onOpenChange={onOpenChangeMock}
title="Settings"
actions={[primaryAction, secondaryAction]}
/>,
Expand All @@ -60,7 +68,6 @@ describe("BaseModal", () => {
});

it("should close the modal after an action is performed", async () => {
const onOpenChangeMock = vi.fn();
render(
<BaseModal
isOpen
Expand All @@ -82,7 +89,7 @@ describe("BaseModal", () => {

it("should render children", () => {
render(
<BaseModal isOpen onOpenChange={vi.fn} title="Settings">
<BaseModal isOpen onOpenChange={onOpenChangeMock} title="Settings">
<div>Children</div>
</BaseModal>,
);
Expand All @@ -93,7 +100,7 @@ describe("BaseModal", () => {
const { rerender } = render(
<BaseModal
isOpen
onOpenChange={vi.fn}
onOpenChange={onOpenChangeMock}
title="Settings"
actions={[
{
Expand All @@ -110,7 +117,7 @@ describe("BaseModal", () => {
rerender(
<BaseModal
isOpen
onOpenChange={vi.fn}
onOpenChange={onOpenChangeMock}
title="Settings"
actions={[
{
Expand All @@ -126,7 +133,6 @@ describe("BaseModal", () => {
});

it.skip("should not close if the backdrop or escape key is pressed", () => {
const onOpenChangeMock = vi.fn();
render(
<BaseModal
isOpen
Expand Down
Loading
Loading