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

@@ -96,6 +96,17 @@ describe('Security, factors', () => {
expect(JSON.stringify(useAuthStore.getState())).not.toContain(SECRET)
})
it('shows the setup key in full as selectable text, with no Copy button', async () => {
const user = userEvent.setup()
mount()
await startEnrolment(user)
const key = await screen.findByText(SECRET)
expect(key.textContent).toBe(SECRET)
expect(key.className).not.toMatch(/select-none/)
expect((key as HTMLElement).style.userSelect).not.toBe('none')
expect(screen.queryByRole('button', { name: /cop(y|ier)/i })).toBeNull()
})
it('cancel removes the unverified factor it created and clears the secret', async () => {
const user = userEvent.setup()
mount()
@@ -125,6 +136,21 @@ describe('Security, factors', () => {
expect(fake.auth.mfa.enroll).not.toHaveBeenCalled()
})
it('refuses a 65-character name without calling GoTrue, accepts 64', async () => {
const user = userEvent.setup()
mount()
await user.click(await screen.findByRole('button', { name: fr['mfa.enrol.start'] }))
const field = screen.getByLabelText(fr['mfa.enrol.name'])
await user.type(field, 'a'.repeat(65))
await user.click(screen.getByRole('button', { name: fr['mfa.enrol.continue'] }))
expect(screen.getByText(fr['mfa.error.name_too_long'].replace('{max}', '64'))).toBeInTheDocument()
expect(fake.auth.mfa.enroll).not.toHaveBeenCalled()
await user.clear(field)
await user.type(field, 'b'.repeat(64))
await user.click(screen.getByRole('button', { name: fr['mfa.enrol.continue'] }))
expect(fake.auth.mfa.enroll).toHaveBeenCalledWith({ factorType: 'totp', friendlyName: 'b'.repeat(64) })
})
it('a second factor at aal1 steps up first, then enrols again', async () => {
const user = userEvent.setup()
setMfa(fake, [fakeFactor({ id: 'f-1' })])