fix(frontend): separate mobile back-to-top control
Deploy Canina / deploy (push) Successful in 2m7s

This commit is contained in:
devops committed 2026-10-17 07:44:07 +00:00
1 parent 5afa2a37be
commit 87ad359e60
2 files changed
+12 -1

No files matched your search

+1 -1
View File
@@ -57,7 +57,7 @@ export default function Footer({
{showScroll && (
<button
onClick={scrollToTop}
className="fixed bottom-20 left-4 sm:bottom-8 sm:left-8 z-40 bg-canina-blue text-white p-2.5 sm:p-3 rounded-full shadow-2xl hover:bg-canina-dark hover:scale-110 transition-all border border-white/20 group flex items-center gap-2 font-vazir text-xs font-black"
className="fixed bottom-36 left-4 sm:bottom-8 sm:left-8 z-40 bg-canina-blue text-white p-2.5 sm:p-3 rounded-full shadow-2xl hover:bg-canina-dark hover:scale-110 transition-all border border-white/20 group flex items-center gap-2 font-vazir text-xs font-black"
title="بازگشت به بالای صفحه"
>
<ArrowUp className="w-4 h-4 sm:w-5 sm:h-5 group-hover:-translate-y-1 transition-transform" />
@@ -25,4 +25,15 @@ describe('Footer', () => {
const trustLink = screen.getByText('نمادهای اعتماد و مجوزهای رسمی').closest('a');
expect(trustLink).toHaveAttribute('href', '/trust-seals');
});
it('keeps the mobile back-to-top control above the support launcher and bottom nav', () => {
render(<Footer onB2BOpen={vi.fn()} />);
Object.defineProperty(window, 'scrollY', { configurable: true, value: 500 });
fireEvent.scroll(window);
const backToTop = screen.getByTitle('بازگشت به بالای صفحه');
expect(backToTop.className).toContain('bottom-36');
expect(backToTop.className).toContain('sm:bottom-8');
});
});