Skip to content

Commit 9fa3452

Browse files
committed
fix(landing): cover navbar logo drag prevention
1 parent 5f3cfa6 commit 9fa3452

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

‎apps/sim/app/(landing)/components/navbar/components/nav-menu-chip/components/nav-menu-logo-marquee/nav-menu-logo-marquee.test.tsx‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ vi.mock('@sim/emcn', () => ({
1010
}))
1111

1212
vi.mock('next/image', () => ({
13-
default: ({ alt, className }: { alt: string; className?: string }) => (
14-
<img alt={alt} className={className} />
15-
),
13+
default: ({
14+
alt,
15+
className,
16+
draggable,
17+
}: {
18+
alt: string
19+
className?: string
20+
draggable?: boolean
21+
}) => <img alt={alt} className={className} draggable={draggable} />,
1622
}))
1723

1824
import { LOGOS } from '@/app/(landing)/components/logos'
@@ -23,7 +29,7 @@ afterEach(() => {
2329
})
2430

2531
describe('NavMenuLogoMarquee', () => {
26-
it('loops two copies of the shared logo row and hides the second from assistive technology', () => {
32+
it('loops two non-draggable logo rows and hides the second from assistive technology', () => {
2733
const host = document.createElement('div')
2834
document.body.append(host)
2935
act(() => {
@@ -44,6 +50,10 @@ describe('NavMenuLogoMarquee', () => {
4450
expect(img.getAttribute('alt')).toBe('')
4551
}
4652

53+
for (const img of host.querySelectorAll('img')) {
54+
expect(img.getAttribute('draggable')).toBe('false')
55+
}
56+
4757
const track = rows[0].parentElement
4858
expect(track?.parentElement?.className).toContain('mask-image')
4959
})

0 commit comments

Comments
 (0)