feat: Update poster dimensions to A4 size and enhance PDF generation tests

This commit is contained in:
hamed
2026-08-09 13:59:37 +03:30
parent 54bebbd41a
commit 5e86f115d3
6 changed files with 131 additions and 17 deletions
+5 -2
View File
@@ -49,13 +49,16 @@ describe.each([
expect(screen.getByText(/تخصص دیگر/)).toBeInTheDocument();
});
it("کادر ثابت ۱۰۸۰×۱۳۵۰ و overflow-hidden دست‌نخورده است", () => {
// ۱۰۸۰×۱۵۲۷ همان نسبت A4 است (۲۱۰:۲۹۷). هر عدد دیگری یعنی PDF یا حاشیهٔ سفید
// می‌گیرد یا از کاغذ بیرون می‌زند.
it("کادر ثابت ۱۰۸۰×۱۵۲۷ با نسبت A4 و overflow-hidden دست‌نخورده است", () => {
const { container } = render(<Component data={JAHANTAB} />);
const frame = container.firstChild;
expect(frame.className).toContain("w-[1080px]");
expect(frame.className).toContain("h-[1350px]");
expect(frame.className).toContain("h-[1527px]");
expect(frame.className).toContain("overflow-hidden");
expect(1527 / 1080).toBeCloseTo(297 / 210, 2);
});
it("خط زیرتخصص از بودجهٔ کاراکتر نمی‌گذرد", () => {