fix(app): creation page waits for own grants; e2e never prints setup keys
Delta verifier: two remaining setup-key assertions now booleans. Its observation: the editor rule read grants before they loaded; authStore.catalogGrantsStatus (loading, ready, failed): the page waits, and a failed read leaves the decision to the server. App 654, e2e:ui 227, admin shell spec 14 + 6 skipped.
This commit is contained in:
1 parent
02625a76b6
commit
f04bfdd040
6 files changed
+37
-11
No files matched your search
@@ -149,7 +149,7 @@ function mount(
|
||||
grants: OwnCatalogGrant[],
|
||||
roles: PlatformRole[] = [],
|
||||
) {
|
||||
useAuthStore.setState({ catalogGrants: grants, roles })
|
||||
useAuthStore.setState({ catalogGrants: grants, catalogGrantsStatus: 'ready', roles })
|
||||
return render(
|
||||
<MemoryRouter initialEntries={[path]}>
|
||||
<Routes>
|
||||
@@ -655,6 +655,15 @@ describe('Sheet creation (A1)', () => {
|
||||
expect(rpcArgs('create_official_sheet')).toEqual([])
|
||||
})
|
||||
|
||||
it('decides nothing while the own grants load, and leaves a failed read to the server', async () => {
|
||||
mount('/app/admin/sheets/new', [])
|
||||
useAuthStore.setState({ catalogGrantsStatus: 'loading' })
|
||||
expect(await screen.findByRole('status')).toHaveTextContent(fr['shell.loading_session'])
|
||||
expect(screen.queryByRole('heading', { name: fr['access_denied.title'] })).toBeNull()
|
||||
useAuthStore.setState({ catalogGrantsStatus: 'failed' })
|
||||
expect(await screen.findByLabelText('Espèce')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('proposes a slug from the French name', () => {
|
||||
expect(proposeSlug('Chien : squelette et rachis ')).toBe(
|
||||
'chien-squelette-et-rachis',
|
||||
|
||||
@@ -29,6 +29,7 @@ const INITIAL = {
|
||||
avatarUrl: null,
|
||||
workspace: { status: 'idle' as const },
|
||||
catalogGrants: [],
|
||||
catalogGrantsStatus: 'loading' as const,
|
||||
}
|
||||
|
||||
let fake: FakeSupabase
|
||||
|
||||
Reference in new issue
Block a user