mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-19 04:00:38 +09:00
fix goal view properties toggle
This commit is contained in:
parent
6a72faf83b
commit
32fe1056e7
2 changed files with 60 additions and 3 deletions
26
ui/src/pages/GoalDetail.test.tsx
Normal file
26
ui/src/pages/GoalDetail.test.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// @vitest-environment node
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
import { GoalPropertiesToggleButton } from "./GoalDetail";
|
||||
|
||||
describe("GoalPropertiesToggleButton", () => {
|
||||
it("shows the reopen control when the properties panel is hidden", () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<GoalPropertiesToggleButton panelVisible={false} onShowProperties={() => {}} />,
|
||||
);
|
||||
|
||||
expect(html).toContain('title="Show properties"');
|
||||
expect(html).toContain("opacity-100");
|
||||
});
|
||||
|
||||
it("collapses the reopen control while the properties panel is already visible", () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<GoalPropertiesToggleButton panelVisible onShowProperties={() => {}} />,
|
||||
);
|
||||
|
||||
expect(html).toContain("opacity-0");
|
||||
expect(html).toContain("pointer-events-none");
|
||||
expect(html).toContain("w-0");
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue