fix(tools): refine tool grid header, mobile touch slider scrolling, and remove duplicates

This commit is contained in:
2026-11-07 12:44:57 +05:30
parent d273fb0489
commit 39fdb0aae1
3 changed files with 214 additions and 163 deletions
+32
View File
@@ -5,6 +5,7 @@ import { Cinematic3DComparison } from '@/components/ui/Cinematic3DComparison';
import { CardBeforeAfterSlider } from '@/components/ui/CardBeforeAfterSlider';
import { ShiftableToolsGridSection } from '@/components/sections/ShiftableToolsGridSection';
import { TrendyBentoSection } from '@/components/sections/TrendyBentoSection';
import { ToolGridSection } from '@/components/sections/ToolGridSection';
describe('Before/After Comparison Sliders (Mobile & Touch Responsiveness)', () => {
it('Cinematic3DComparison arrow handle has touch-none, role="slider", and touchAction: none', () => {
@@ -62,4 +63,35 @@ describe('Before/After Comparison Sliders (Mobile & Touch Responsiveness)', () =
expect(html).toContain('href="/tools/old-photo-restorer"');
expect(html).toContain('href="/tools/cartoon-avatar"');
});
it('ToolGridSection comparison cards allow smooth mobile scrolling (touch-action: pan-y) and drag only on handle button (touch-action: none)', () => {
const html = renderToString(
<ToolGridSection
tools={[
{
id: 'blemish-remover',
slug: 'blemish-remover',
name: { en: 'Blemish Remover' },
summary: { en: 'Smooth blemishes' },
category: 'portrait-retouch',
content: {
examples: [
{
before: '/before.jpg',
after: '/after.jpg',
},
],
},
} as any,
]}
/>
);
expect(html).toContain('role="slider"');
expect(html).toContain('aria-label="Before and after transformation slider"');
expect(html).toContain('touch-none');
expect(html).toContain('touch-action:none');
expect(html).toContain('touch-action:pan-y');
expect(html).toContain('touch-pan-y');
});
});