Skip to content

Commit 4cf7316

Browse files
authored
Merge pull request #331 from aha-hyeong/fix/missing-number-notice-default-collapsed
fix: 누락 회차 안내 기본 접힘 상태로 변경
2 parents 8c64a8e + c9b5b86 commit 4cf7316

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

web/src/components/SeriesInfoCard.test.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe("SeriesInfoCard description", () => {
5353
expect(screen.queryByRole("button", { name: /series\.missing_/ })).not.toBeInTheDocument();
5454
});
5555

56-
it("누락 회차 안내를 클릭하면 아이콘만 남기고 다시 클릭하면 펼친다", () => {
56+
it("누락 회차 안내는 기본으로 접혀 있고 클릭하면 내용을 펼친다", () => {
5757
render(
5858
<SeriesInfoCard
5959
series={{ ...series, display_unit: "volume" }}
@@ -66,15 +66,16 @@ describe("SeriesInfoCard description", () => {
6666
);
6767

6868
const notice = screen.getByRole("button", { name: "series.missing_volumes:9권, 12권" });
69-
expect(notice).toHaveTextContent("series.missing_volumes:9권, 12권");
70-
71-
fireEvent.click(notice);
72-
7369
expect(notice).toHaveAttribute("aria-pressed", "true");
7470
expect(notice).not.toHaveTextContent("series.missing_volumes:9권, 12권");
7571

7672
fireEvent.click(notice);
73+
7774
expect(notice).toHaveAttribute("aria-pressed", "false");
7875
expect(notice).toHaveTextContent("series.missing_volumes:9권, 12권");
76+
77+
fireEvent.click(notice);
78+
expect(notice).toHaveAttribute("aria-pressed", "true");
79+
expect(notice).not.toHaveTextContent("series.missing_volumes:9권, 12권");
7980
});
8081
});

web/src/components/SeriesInfoCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function SeriesInfoCard({
5454
const [isEditModalOpen, setIsEditModalOpen] = useState(false);
5555
const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false);
5656
const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);
57-
const [isMissingNumberNoticeCollapsed, setIsMissingNumberNoticeCollapsed] = useState(false);
57+
const [isMissingNumberNoticeCollapsed, setIsMissingNumberNoticeCollapsed] = useState(true);
5858
const descriptionRef = useRef<HTMLParagraphElement | null>(null);
5959
const [isProcessing, setIsProcessing] = useState(false);
6060
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
@@ -180,7 +180,7 @@ export function SeriesInfoCard({
180180
}, [displayDescription]);
181181

182182
useEffect(() => {
183-
setIsMissingNumberNoticeCollapsed(false);
183+
setIsMissingNumberNoticeCollapsed(true);
184184
}, [missingNumberNoticeLabel]);
185185

186186
useEffect(() => {

0 commit comments

Comments
 (0)