feat(integration): add image variants section and standardize code snippets

This commit is contained in:
Florian Sylvain committed 2026-10-12 23:27:41 +02:00
1 parent 6f9ae6207a
commit e6746f2be7
28 files changed
+2256 -422

No files matched your search

+18 -13
View File
@@ -690,7 +690,9 @@ describe('Create key: success reveals the key once', () => {
const warning = modal.querySelector('[role="alert"]')!
expect(warning.textContent).toContain("You won't be able to see this key again.")
expect(modal.textContent).toContain(FULL_KEY)
expect(modal.querySelector('.font-mono')?.textContent?.trim()).toBe(FULL_KEY)
expect(modal.querySelector('pre')?.textContent?.trim()).toBe(FULL_KEY)
expect(modal.querySelector('[role="tablist"]')?.textContent?.trim()).toBe('API key')
expect(modal.querySelectorAll('[role="tab"]')).toHaveLength(0)
expect(modal.textContent).toContain(
'Closing this window discards the key from the screen. Copy it first.',
)
@@ -759,7 +761,7 @@ describe('One-time reveal: copied', () => {
expect(copied).toBeTruthy()
expect(copied.className).toContain('text-success')
expect(iconOf(copied)).toBe('i-lucide-check')
expect(copied.getAttribute('aria-live')).toBe('polite')
expect(copied.getAttribute('aria-label')).toBe('Copy code')
expect(formModal()!.querySelector('[aria-live="polite"]')?.textContent?.trim()).toBe(
'Copied',
)
@@ -942,18 +944,21 @@ describe('Mobile Create key button, not drawn on board', () => {
{ name: 'list', list: () => Promise.resolve(ownerFixture()) },
{ name: 'loading', list: () => deferred<ApiKey[]>().promise },
{ name: 'error', list: () => Promise.reject(new ApiError(500)) },
])('is pinned in a sticky footer, full width and 48 px in $name with no header button', async ({ list }) => {
await mountPage({ list }, { desktop: false })
])(
'is pinned in a sticky footer, full width and 48 px in $name with no header button',
async ({ list }) => {
await mountPage({ list }, { desktop: false })
const buttons = buttonsIn(document.body).filter(
(button) => button.textContent?.trim() === 'Create key',
)
expect(buttons).toHaveLength(1)
expect(buttons[0]!.parentElement!.className).toContain('sticky')
expect(buttons[0]!.className).toContain('h-12')
expect(buttons[0]!.className).toContain('w-full')
expect(buttons[0]!.parentElement!.style.display).not.toBe('none')
})
const buttons = buttonsIn(document.body).filter(
(button) => button.textContent?.trim() === 'Create key',
)
expect(buttons).toHaveLength(1)
expect(buttons[0]!.parentElement!.className).toContain('sticky')
expect(buttons[0]!.className).toContain('h-12')
expect(buttons[0]!.className).toContain('w-full')
expect(buttons[0]!.parentElement!.style.display).not.toBe('none')
},
)
it('is not drawn in the Empty state', async () => {
await mountPage({ list: () => Promise.resolve([]) }, { desktop: false })