Skip to content

Commit d744fd9

Browse files
committed
EVEN more test
1 parent 0bf52cd commit d744fd9

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

e2e/chat.spec.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { expect } from '@playwright/test'
22
import { acceptDisclaimer, closeSendPreference, sendChatMessage, useMockModel } from './utils/test-helpers'
33
import { TestByRole } from './fixtures'
4+
import { FREE_MODEL, validModels } from '../src/config'
45

56
// Matrix of tests
67
const testMatrix: { role: keyof typeof TestByRole; courses: (string | undefined)[] }[] = [
@@ -93,6 +94,11 @@ testMatrix.forEach((testConfig) => {
9394
await expect(page.getByTestId('user-message')).toContainText('tää tyhjennetään')
9495
await expect(page.getByTestId('assistant-message')).toContainText('OVER', { timeout: 6000 })
9596

97+
await sendChatMessage(page, 'ja tämä')
98+
99+
await expect(page.getByTestId('user-message')).toContainText('ja tämä')
100+
await expect(page.getByTestId('assistant-message')).toContainText('OVER', { timeout: 6000 })
101+
96102
page.on('dialog', (dialog) => dialog.accept())
97103
await page.getByTestId('empty-conversation-button').click()
98104

@@ -154,7 +160,7 @@ testMatrix.forEach((testConfig) => {
154160
await expect(page.getByTestId('assistant-message').last()).toContainText('Temperature: 1')
155161
})
156162

157-
if (course)
163+
if (course) {
158164
test('Course chat RAG feature', async ({ page }) => {
159165
await acceptDisclaimer(page)
160166
await useMockModel(page)
@@ -181,6 +187,20 @@ testMatrix.forEach((testConfig) => {
181187
// Three source items should be visible
182188
await expect(page.getByTestId('sources-truncated-item')).toHaveCount(3)
183189
})
190+
}
191+
192+
if (!course) {
193+
test('Every validModel is available in general chat', async ({ page }) => {
194+
await acceptDisclaimer(page)
195+
await page.getByTestId('model-selector').first().click()
196+
197+
const modelNames = validModels.map((modelConfig) => (modelConfig.name + FREE_MODEL === modelConfig.name ? ' (free)' : ''))
198+
199+
for (const name of modelNames) {
200+
await expect(page.getByText(name, { exact: true }).first()).toBeVisible()
201+
}
202+
})
203+
}
184204
})
185205
})
186206
})

0 commit comments

Comments
 (0)