fix(ux-33): prevent support button overlap on contact form and elevate with safe-area spacing

This commit is contained in:
devops committed 2026-10-17 18:56:13 +00:00
1 parent f23efbf90d
commit b5b4e64453
3 files changed
+39 -2

No files matched your search

@@ -0,0 +1,37 @@
import React from "react";
import { describe, it, expect, vi } from "vitest";
import { render, waitFor } from "@testing-library/react";
// Mock fetch for SupportChat config
const mockFetch = vi.fn().mockImplementation(() =>
Promise.resolve({
ok: true,
json: () =>
Promise.resolve({
data: {
enabled: true,
label: "پشتیبانی آنلاین",
icon: "chat",
},
}),
})
);
global.fetch = mockFetch as any;
import SupportChat from "../SupportChat";
describe("SupportChat Safe Area & Positioning (UX-33)", () => {
it("ensures SupportChat launcher has bottom-24 on mobile and safe-area inset to avoid overlapping contact form actions and bottom nav", async () => {
const { container } = render(<SupportChat />);
await waitFor(() => {
const aside = container.querySelector("aside");
expect(aside).not.toBeNull();
expect(aside?.className).toContain("fixed");
expect(aside?.className).toContain("bottom-24");
expect(aside?.className).toContain("sm:bottom-6");
expect(aside?.className).toContain("left-4");
expect(aside?.className).toContain("pb-[env(safe-area-inset-bottom,0px)]");
});
});
});