refac: DELETE /v1/user/{id}?expected_role_id=N, user.remove audit event, 409 target_role_not_found, GetAll returns its error, Own-scope visibility filter moved into repos, JSON tags removed from use-case types

This commit is contained in:
Florian Sylvain committed 2026-10-29 16:28:25 +01:00
1 parent 5d6f378fce
commit b39a41be88
124 files changed
+8816 -523

No files matched your search

+7 -5
View File
@@ -29,8 +29,9 @@ vi.mock('@nuxt/ui/composables', async (importOriginal) => {
const LIST_PATH = '/v1/user/'
const INVITE_PATH = '/v1/user/invite'
const INVALID_EMAIL = 'Enter a full email address, like name@example.com.'
const FAILED_ALERT = "Couldn't send the invite. Try again in a moment."
const INVALID_EMAIL = 'Enter a valid email address.'
const FAILED_TITLE = "Couldn't send the invite"
const FAILED_DESCRIPTION = 'Try again in a moment.'
const VALID_EMAIL = 'lea.martin@renew.example'
function defaultFixture(): UserListItem[] {
@@ -726,7 +727,8 @@ describe('Invite: 409 conflicts are told apart by the error code', () => {
await openModal()
await submitWith('jonas@renew.example')
expect(alertText()).toContain(FAILED_ALERT)
expect(alertText()).toContain(FAILED_TITLE)
expect(alertText()).toContain(FAILED_DESCRIPTION)
expect(dialog()?.textContent).not.toContain('This address already has an account.')
expect(emailInput().disabled).toBe(false)
})
@@ -783,7 +785,7 @@ describe('Invite: failed — a 500 or a network failure keeps the address and of
},
{
name: 'a 500 with the API text',
failure: () => Promise.reject(new ApiError(500, undefined, FAILED_ALERT)),
failure: () => Promise.reject(new ApiError(500, undefined, FAILED_TITLE)),
},
{
name: 'a network failure',
@@ -794,7 +796,7 @@ describe('Invite: failed — a 500 or a network failure keeps the address and of
await openModal()
await submitWith(VALID_EMAIL)
expect(alertText()).toBe(FAILED_ALERT)
expect(alertText()).toBe(`${FAILED_TITLE}${FAILED_DESCRIPTION}`)
expect(document.body.querySelectorAll('[role="alert"]')).toHaveLength(1)
expect(emailInput().value).toBe(VALID_EMAIL)
expect(emailInput().disabled).toBe(false)