feat: sites and authors integration into existing screens (& formated all frontend files kinda accidentally)

This commit is contained in:
Florian Sylvain committed 2026-10-15 05:25:44 +02:00
1 parent 3d81d2c717
commit 6b8990c55e
239 files changed
+9194 -1354

No files matched your search

+13 -4
View File
@@ -193,7 +193,9 @@ describe('Authors: search and pagination in the URL', () => {
it('requests the page and size found in the URL', async () => {
const backend = createBackend()
backend.authors = manyAuthors(130)
await mountDirectory('authors', '/authors?q=writer&page=2&size=50', { backend })
await mountDirectory('authors', '/authors?q=writer&page=2&size=50', {
backend,
})
expect(listCalls(backend)[0]!.raw).toBe('/v1/author/?q=writer&page=2&size=50')
expect(document.body.textContent).toContain('Showing 51–100 of 130')
@@ -259,7 +261,10 @@ describe('Authors: row menu for an owner or admin', () => {
describe('Authors: read-only list for other roles', () => {
it('has no Add author button, no pinned button, no row menu and a chevron on each row', async () => {
await mountDirectory('authors', '/authors', { role: 'member', width: MOBILE_WIDTH })
await mountDirectory('authors', '/authors', {
role: 'member',
width: MOBILE_WIDTH,
})
expect(document.body.textContent).toContain(READ_ONLY_DESCRIPTION)
expect(button('Add author')).toBeUndefined()
@@ -271,7 +276,9 @@ describe('Authors: read-only list for other roles', () => {
it('keeps search working and shows the Authors sidebar entry on desktop', async () => {
vi.useFakeTimers()
const backend = await mountDirectory('authors', '/authors', { role: 'member' })
const backend = await mountDirectory('authors', '/authors', {
role: 'member',
})
expect(
document.body.querySelector('nav[aria-label="Main"] a[href="/authors"]'),
@@ -314,7 +321,9 @@ describe('Authors: read-only detail', () => {
})
it('opens the same panel from /authors?edit=ines-duarte', async () => {
await mountDirectory('authors', '/authors?edit=ines-duarte', { role: 'member' })
await mountDirectory('authors', '/authors?edit=ines-duarte', {
role: 'member',
})
expect(textOf(dialog())).toContain('Only an owner or admin can change this author.')
expect(dialog()!.querySelectorAll('input, textarea')).toHaveLength(0)