* fix(ai): confirm deleting a conversation in the standard dialog Deleting a conversation asked inside the chat panel's header, unlike every other destructive confirmation, which uses AppConfirmationDialog. It now opens that dialog, which names the conversation; Cancel keeps it and Delete removes it. * feat(ai): dim a reverted reply's content A reverted reply still showed its tool cards with their success marks and its text as if the edits were there; only the line below said otherwise. Its content is now dimmed, while the Changes reverted or Restore changes line and the other actions stay at full strength. * ci: typecheck the test suites in Code quality bun run check runs check:test-types, but PR CI did not, so tests that no longer type-checked could merge and break bun run check on master, as the grid fixtures from #866 did. It runs as a step of Code quality, which already builds the package declarations it needs; the check takes about two seconds, less than a separate job's setup. * test(ai): time the reasoning auto-close with the fake clock The test slept 1200 ms of real time past the 1000 ms auto-close to show that a manually opened block stays open, which was timing-dependent under load. It now advances Playwright's clock past the timer. With manual opening ignored, it fails. * test(ai): skip file identity on Playwright's bundled Chromium on macOS There, reading a FileSystemFileHandle back from IndexedDB closes the page before any app code runs, so the test always failed locally on a Mac. Installed Google Chrome on the same machine reads and compares the handle correctly, and the app's resolveFile returns one ID for twelve concurrent calls there. The skip is limited to the bundled build on macOS. * fix(settings): keep a model picker open while the editor slides in The models panel focused the editor's first field after its enter transition, even when focus had already moved into the editor, closing a picker opened during the animation. It now leaves focus alone once it has moved since the editor opened. * test: serve a fixed model catalog and wait for the editor before Settings shortcuts Chat tests fetched the live models.dev catalog, so the model list changed under them; they now get a small fixed one. The credentials test pressed the Settings shortcut before the editor was ready. * fix(settings): move drill-in focus with Reka's FocusScope The drill-in focused the detail's first field after its slide-in ended, found by querying the DOM, and restored focus by hand, so a picker opened during the slide closed. FocusScope now focuses the detail as it mounts and returns focus to what opened it. A caller can prevent open-auto-focus to focus its own field, which the models panel does for the profile name through the editor's exposed focus(). * test(ai): answer the Vision model's request in chat tests A message with images is analyzed by the Vision model, which calls OpenRouter directly rather than the mocked chat transport. With the test key the request failed, and since #916 a failure before dispatch takes the message back, so the WebKit history test never got a reply. The chat fixture now answers that request with fixed findings. * test(ai): check that deletion persists and reverted replies dim The delete test passed even if the conversation stayed in storage, since the panel clears its messages before the store removes it; it now reloads and checks the history. The revert test checked only data-reverted; it now checks the rendered opacity too.
40 lines
1.8 KiB
TypeScript
40 lines
1.8 KiB
TypeScript
import { CATALOG_ONLY_MODEL } from '#tests/helpers/chat/catalog'
|
|
import { expect, test } from '#tests/helpers/chat/fixture'
|
|
|
|
test('Design profile selector exposes provider and capabilities', async ({
|
|
configuredChat: chat
|
|
}) => {
|
|
await chat.profileTrigger.click()
|
|
|
|
await expect(chat.page.getByText('Design agent', { exact: true })).toBeVisible()
|
|
await expect(chat.page.getByRole('option', { name: /Claude Sonnet/ })).toContainText('OpenRouter')
|
|
await expect(chat.page.getByLabel('Supports image input')).toBeVisible()
|
|
await expect(chat.page.getByRole('button', { name: 'Manage models and roles…' })).toBeVisible()
|
|
})
|
|
|
|
test('OpenRouter accepts a custom model ID from Settings', async ({ configuredChat: chat }) => {
|
|
const customModel = 'meta-llama/llama-3.3-70b-instruct'
|
|
await chat.page.getByTestId('provider-settings-trigger').click()
|
|
await chat.page.locator('[data-model-id]').first().click()
|
|
await chat.page.getByLabel('Model ID').click()
|
|
// The catalog replaces the fallback list once it loads; pick only after it has settled.
|
|
await expect(chat.page.getByRole('option', { name: CATALOG_ONLY_MODEL })).toBeVisible()
|
|
await chat.page.getByRole('option', { name: 'Custom model…' }).click()
|
|
const input = chat.page.getByTestId('provider-settings-custom-model')
|
|
await input.fill(customModel)
|
|
await chat.page.getByRole('button', { name: 'Save model' }).click()
|
|
await chat.page.getByTestId('app-settings-done').click()
|
|
|
|
await expect(chat.profileTrigger).toContainText('Claude Sonnet')
|
|
})
|
|
|
|
test('Get API key links to the provider key page', async ({ configuredChat: chat }) => {
|
|
await chat.page.getByTestId('provider-settings-trigger').click()
|
|
await chat.page.locator('[data-model-id]').first().click()
|
|
|
|
await expect(chat.page.getByRole('link', { name: 'Get API key' })).toHaveAttribute(
|
|
'href',
|
|
'https://openrouter.ai/keys'
|
|
)
|
|
})
|