Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat/add-side-panel' into feat/a…
Browse files Browse the repository at this point in the history
…dd-side-panel

# Conflicts:
#	src/domains/dashboard/pages/Dashboard/Dashboard.tsx
  • Loading branch information
shahin-hq committed Jan 17, 2025
2 parents 6b06b15 + 3ee3b1d commit a97ca3c
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/app/components/SidePanel/SidePanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,46 @@ import { render, screen } from "@testing-library/react";

describe("SidePanel", () => {
it("should render string header", () => {
render(<SidePanel open={true} onOpenChange={vi.fn()} header="side panel header"> panel body </SidePanel>);
render(
<SidePanel open={true} onOpenChange={vi.fn()} header="side panel header">
{" "}
panel body{" "}
</SidePanel>,
);

expect(screen.getByText("side panel header")).toBeInTheDocument();
});

it("should render component header", () => {
render(<SidePanel open={true} onOpenChange={vi.fn()} header={<div>side panel header</div>}> panel body </SidePanel>);
render(
<SidePanel open={true} onOpenChange={vi.fn()} header={<div>side panel header</div>}>
{" "}
panel body{" "}
</SidePanel>,
);

expect(screen.getByText("side panel header")).toBeInTheDocument();
});

it("should render body", () => {
render(<SidePanel open={true} onOpenChange={vi.fn()}> panel body </SidePanel>);
render(
<SidePanel open={true} onOpenChange={vi.fn()}>
{" "}
panel body{" "}
</SidePanel>,
);

expect(screen.getByText("panel body")).toBeInTheDocument();
});

it("should close the panel", async () => {
const onOpenChangeMock = vi.fn();
render(<SidePanel open={true} onOpenChange={onOpenChangeMock}> panel body </SidePanel>);
render(
<SidePanel open={true} onOpenChange={onOpenChangeMock}>
{" "}
panel body{" "}
</SidePanel>,
);

expect(screen.getByText("panel body")).toBeInTheDocument();

Expand Down

0 comments on commit a97ca3c

Please sign in to comment.