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

+39 -8
View File
@@ -205,11 +205,18 @@ async function mountPage(handlers: Handlers = {}, options: MountOptions = {}) {
throw new Error(`Unexpected request: ${path}`)
})
vi.mocked(useApi).mockReturnValue({
getMe: vi.fn().mockResolvedValue({ verified: true, username, id: 1, role: sessionRole }),
getMe: vi.fn().mockResolvedValue({
verified: true,
username,
id: 1,
role: sessionRole,
}),
request: requestMock,
})
await router.push('/integration/api-keys')
const Host = defineComponent({ render: () => h(UApp, null, () => h(ApiKeysView)) })
const Host = defineComponent({
render: () => h(UApp, null, () => h(ApiKeysView)),
})
wrapper = mount(Host, {
attachTo: document.body,
global: { plugins: [router, uiPlugin] },
@@ -378,7 +385,10 @@ function alertText() {
function stubClipboard() {
const writeText = vi.fn().mockResolvedValue(undefined)
Object.defineProperty(navigator, 'clipboard', { configurable: true, value: { writeText } })
Object.defineProperty(navigator, 'clipboard', {
configurable: true,
value: { writeText },
})
return writeText
}
@@ -618,7 +628,12 @@ describe('Create key: validation', () => {
it.each([
{ name: '', expiry: '2026-03-12', nameError: true, expiryError: true },
{ name: '', expiry: '', nameError: true, expiryError: false },
{ name: 'Deploy', expiry: '2026-03-12', nameError: false, expiryError: true },
{
name: 'Deploy',
expiry: '2026-03-12',
nameError: false,
expiryError: true,
},
])(
'name "$name" and expiry "$expiry" sends nothing',
async ({ name, expiry, nameError, expiryError }) => {
@@ -1007,8 +1022,16 @@ describe('Not drawn: Create sending', () => {
describe('Not drawn: Create failed', () => {
it.each([
{ name: 'status 500', failure: () => new ApiError(500), copy: CREATE_FAILED_COPY },
{ name: 'a network error', failure: () => new NetworkError(), copy: CONNECTION_COPY },
{
name: 'status 500',
failure: () => new ApiError(500),
copy: CREATE_FAILED_COPY,
},
{
name: 'a network error',
failure: () => new NetworkError(),
copy: CONNECTION_COPY,
},
{
name: 'status 429',
failure: () => new ApiError(429),
@@ -1069,8 +1092,16 @@ describe('Not drawn: Revoke sending', () => {
})
describe.each([
{ name: 'status 500', failure: () => new ApiError(500), copy: REVOKE_FAILED_COPY },
{ name: 'a network error', failure: () => new NetworkError(), copy: CONNECTION_COPY },
{
name: 'status 500',
failure: () => new ApiError(500),
copy: REVOKE_FAILED_COPY,
},
{
name: 'a network error',
failure: () => new NetworkError(),
copy: CONNECTION_COPY,
},
])('Not drawn: Revoke failed: $name', ({ failure, copy }) => {
it('shows the notice in the open dialog, leaves the row and lets a retry succeed', async () => {
let attempts = 0