fix(ui): bundle the footer's ZenQuality logo (production CSP img-src 'self' refused the hotlink); CSP proof counts every violation; gitleaks allowlist carries the owner's [gated 2026-10-18] marker
This commit is contained in:
1 parent
1814a8d7d7
commit
dcc79400de
7 files changed
+163
-17
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import Footer from '@/components/brand/Footer'
|
||||
|
||||
// The production CSP is `img-src 'self' data: blob:` (DEPLOY.md): every
|
||||
// footer image must be served by the application itself (R4.10j, the
|
||||
// ZenQuality logo was hotlinked from zenquality.fr and refused).
|
||||
describe('Footer', () => {
|
||||
it('serves every image from the application, never an external host', () => {
|
||||
render(<Footer />)
|
||||
const sources = screen.getAllByRole('img').map((img) => img.getAttribute('src'))
|
||||
expect(sources).toHaveLength(2)
|
||||
for (const src of sources) {
|
||||
expect(src).toMatch(/^\/|^data:|^blob:/)
|
||||
expect(src).not.toMatch(/^https?:/)
|
||||
}
|
||||
})
|
||||
|
||||
it('keeps the credit links', () => {
|
||||
render(<Footer />)
|
||||
expect(screen.getByRole('link', { name: 'ZenQuality' })).toHaveAttribute(
|
||||
'href',
|
||||
'https://zenquality.fr',
|
||||
)
|
||||
expect(screen.getByRole('link', { name: 'Paws in Harmony' })).toHaveAttribute(
|
||||
'href',
|
||||
'https://www.instagram.com/paws.iin.harmony',
|
||||
)
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user