fix(app): grant expiry ends the chosen day in Paris; species order 0..9999 (V1-2.5 L2)

Owner checkpoint 2026-11-02: expiry 23:59:59.999 Europe/Paris (picker, validation, display), tests under non-Paris zones and DST days; M7 redefines create_species and update_inactive_species with the range check; pgTAP 015 and 022; « Relecteur ou relectrice »; object_conflict EN; setup key selectable, no Copy.
This commit is contained in:
bchanot committed 2026-11-02 21:29:33 +01:00
1 parent 4111efa1d1
commit 51225cacf6
17 files changed
+437 -61

No files matched your search

+2 -35
View File
@@ -33,7 +33,7 @@ import AdminSheetRoute from '@/app/routes/app/admin/AdminSheetRoute'
import AdminSpeciesRoute from '@/app/routes/app/admin/AdminSpeciesRoute'
import AdminAccessRoute from '@/app/routes/app/admin/AdminAccessRoute'
import { NO_FILTER, filterSheets } from '@/admin/filters'
import { parseGrant, proposeSlug } from '@/admin/validation'
import { proposeSlug } from '@/admin/validation'
import { setCoreRuntime } from '@/core/runtime'
import { useAuthStore } from '@/state/authStore'
import { useLocaleStore } from '@/state/localeStore'
@@ -489,7 +489,7 @@ describe('Rights (A0, §5.2)', () => {
await user.click(screen.getByRole('button', { name: 'Attribuer' }))
expect(screen.getByText(fr['admin.access.error.kind'])).toBeInTheDocument()
await user.click(screen.getByLabelText('Relecteur, relectrice'))
await user.click(screen.getByLabelText('Relecteur ou relectrice'))
await user.type(screen.getByLabelText('Motif'), 'Relecture')
await user.type(screen.getByLabelText(/Échéance/), '2020-01-01')
await user.click(screen.getByRole('button', { name: 'Attribuer' }))
@@ -582,39 +582,6 @@ describe('Rights (A0, §5.2)', () => {
)
expect(await screen.findByText('Droit révoqué.')).toBeInTheDocument()
})
it('parseGrant: the reader needs no note; the expiry is the end of the chosen day', () => {
const parsed = parseGrant(
{
kind: 'catalog_reader',
reason: ' Lecture ',
verification_note: '',
expires_on: '2026-12-31',
},
'2026-11-02',
)
expect(parsed).toEqual({
ok: true,
value: {
kind: 'catalog_reader',
reason: 'Lecture',
expires_at: new Date('2026-12-31T23:59:59').toISOString(),
},
})
const today = parseGrant(
{
kind: 'catalog_reader',
reason: 'x',
verification_note: '',
expires_on: '2026-11-02',
},
'2026-11-02',
)
expect(today).toMatchObject({
ok: false,
errors: { expires_on: 'admin.access.error.expiry' },
})
})
})
describe('Official sheets list (H1)', () => {