feat(app): export and import through @faunosteo/pdf — snapshot, archived branding and labels, browser rasterizer, imported archive kept in session, explicit rebase with messages; legacy PDF modules removed
This commit is contained in:
1 parent
20dafc0b00
commit
9bd5173a9c
43 files changed
+1492
-1989
No files matched your search
@@ -21,6 +21,7 @@ import {
|
||||
waitFor,
|
||||
} from '@testing-library/react'
|
||||
import { MemoryRouter, Route, Routes } from 'react-router-dom'
|
||||
import type { ArchiveReadOutcome } from '@faunosteo/domain'
|
||||
import HomeRoute from '@/app/routes/HomeRoute'
|
||||
import { ImportError, importReportFromPdf } from '@/pdf/import'
|
||||
import { useReportStore } from '@/state/reportStore'
|
||||
@@ -42,7 +43,11 @@ beforeAll(async () => {
|
||||
})
|
||||
beforeEach(() => {
|
||||
useLocaleStore.setState({ locale: 'fr' })
|
||||
useReportStore.setState({ report: null, activeObservationIndex: 0 })
|
||||
useReportStore.setState({
|
||||
report: null,
|
||||
archive: null,
|
||||
activeObservationIndex: 0,
|
||||
})
|
||||
vi.stubGlobal('alert', vi.fn())
|
||||
importMock.mockReset()
|
||||
})
|
||||
@@ -51,14 +56,16 @@ afterEach(() => {
|
||||
vi.unstubAllGlobals()
|
||||
})
|
||||
|
||||
/** The outcome shape importReportFromPdf resolves with. */
|
||||
/** The outcome shape importReportFromPdf resolves with (bare report, no archive). */
|
||||
function outcome(patch: {
|
||||
migrated: boolean
|
||||
unresolvedZones?: number
|
||||
unresolvedFindings?: number
|
||||
}) {
|
||||
}): ArchiveReadOutcome {
|
||||
return {
|
||||
report: minimalReport(sheet),
|
||||
origin: patch.migrated ? 'v2' : 'bare_v3',
|
||||
archive: null,
|
||||
unresolvedZones: 0,
|
||||
unresolvedFindings: 0,
|
||||
...patch,
|
||||
|
||||
Reference in new issue
Block a user