fix(app): closed hash and canonical-form drawing messages, split crop and drawing views
This commit is contained in:
1 parent
7bf1404946
commit
1bbf97e65b
16 files changed
+487
-248
No files matched your search
@@ -111,7 +111,7 @@ describe('Vues et illustrations: drawing states', () => {
|
||||
).toBeTruthy()
|
||||
})
|
||||
|
||||
it('a rejected drawing shows the core detail', async () => {
|
||||
it('a rejected drawing shows the closed not-canonical message, no raw detail', async () => {
|
||||
const bytes = new TextEncoder().encode(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"> <rect width="4" height="4"/></svg>',
|
||||
)
|
||||
@@ -125,8 +125,29 @@ describe('Vues et illustrations: drawing states', () => {
|
||||
store.getState().open('ver-1', 'user-1', { canEdit: true })
|
||||
await vi.waitFor(() => expect(store.getState().status).toBe('ready'))
|
||||
render(<ViewsTab {...props} />)
|
||||
expect(screen.getByText(/Illustration refusée/)).toBeTruthy()
|
||||
expect(screen.getByText(/Détail : not_canonical/)).toBeTruthy()
|
||||
expect(
|
||||
screen.getByText(
|
||||
/Illustration refusée : elle n'est pas sous la forme enregistrée/,
|
||||
),
|
||||
).toBeTruthy()
|
||||
expect(screen.queryByText(/not_canonical/)).toBeNull()
|
||||
})
|
||||
|
||||
it('bytes that fail the hash check at load show their own message, not « introuvable »', async () => {
|
||||
store.getState().close()
|
||||
sb.getSheetVersion.mockResolvedValue(
|
||||
versionAnswer(baseText(), 3, true) as never,
|
||||
)
|
||||
sb.downloadSheetDrawing.mockResolvedValue(
|
||||
new TextEncoder().encode('<svg/>'),
|
||||
)
|
||||
store.getState().open('ver-1', 'user-1', { canEdit: true })
|
||||
await vi.waitFor(() => expect(store.getState().status).toBe('ready'))
|
||||
render(<ViewsTab {...props} />)
|
||||
expect(
|
||||
screen.getByText(/ne correspond pas à son empreinte enregistrée/),
|
||||
).toBeTruthy()
|
||||
expect(screen.queryByText(/introuvable/)).toBeNull()
|
||||
})
|
||||
|
||||
it('read-only shows states as text and no action', async () => {
|
||||
|
||||
Reference in new issue
Block a user