fix(editor): verifier gaps: ratified wordings, copy messages, real SVG journeys

This commit is contained in:
bchanot committed 2026-11-04 17:27:45 +01:00
1 parent 9ba6d2b66c
commit d10ba5d5dd
18 files changed
+227 -97

No files matched your search

+11 -14
View File
@@ -4,6 +4,7 @@ import { expect, expectAccessible, test } from '../support/browser'
import { dropLateReplays, routeToSandbox } from '../support/sandbox'
import {
DRAWING_SVG,
INKSCAPE_EXPORT,
editorActor,
openEditor,
seedDraft,
@@ -20,21 +21,11 @@ import {
const dict = fr
const INKSCAPE_SVG =
'<svg xmlns="http://www.w3.org/2000/svg" ' +
'xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" ' +
'xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" ' +
'viewBox="0 0 400 300" inkscape:version="1.3">' +
'<sodipodi:namedview id="base" inkscape:zoom="0.5"/>' +
'<metadata id="m1"><x:xmpmeta xmlns:x="adobe:ns:meta/"/></metadata>' +
'<style>.a{fill:#c96}</style>' +
'<rect class="a" x="20" y="20" width="360" height="260"/></svg>'
const HOSTILE_SVG =
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 300">' +
'<script>alert(1)</script><rect x="20" y="20" width="360" height="260"/></svg>'
const file = (svg: string, name = 'dessin.svg') => ({
const file = (svg: string | Buffer, name = 'dessin.svg') => ({
name,
mimeType: 'image/svg+xml',
buffer: Buffer.from(svg),
@@ -92,7 +83,9 @@ test.describe('editor drawings (A2)', () => {
await openEditor(page, dict, actor, seed.sheetId)
await selectTab(page, dict, 'views')
await mainFile(page).setInputFiles(file(INKSCAPE_SVG, 'inkscape.svg'))
await mainFile(page).setInputFiles(
file(INKSCAPE_EXPORT, 'inkscape-1.4.3.svg'),
)
const dialog = page.getByRole('dialog', {
name: dict['editor.cleaning.title'],
})
@@ -100,7 +93,9 @@ test.describe('editor drawings (A2)', () => {
await expect(
dialog.getByTestId('cleaning-preview').locator('svg'),
).toBeVisible()
await expect(dialog.getByText(dict['editor.cleaning.style'])).toBeVisible()
await expect(
dialog.getByText(dict['editor.cleaning.removed']),
).toBeVisible()
await expectAccessible(page, 'the cleaning box')
await dialog
.getByRole('button', { name: dict['editor.cleaning.cancel'] })
@@ -110,7 +105,9 @@ test.describe('editor drawings (A2)', () => {
mainDrawing(page).getByText(dict['editor.views.drawing.none']),
).toBeVisible()
await mainFile(page).setInputFiles(file(INKSCAPE_SVG, 'inkscape.svg'))
await mainFile(page).setInputFiles(
file(INKSCAPE_EXPORT, 'inkscape-1.4.3.svg'),
)
await dialog
.getByRole('button', { name: dict['editor.cleaning.confirm'] })
.click()