Open History to see the last commit
1import { test, expect } from '@playwright/test'
2import { providersFor } from './test-matrix'
3
4test.describe('providersFor', () => {
5 test('local default chat uses openai, anthropic, and gemini', () => {
6 expect(providersFor('chat', {})).toEqual(['openai', 'anthropic', 'gemini'])
7 })
8
9 test('local default sound-effects uses elevenlabs when the default three do not support it', () => {
10 expect(providersFor('sound-effects', {})).toEqual(['elevenlabs'])
11 })
12
13 test('explicit E2E_PROVIDERS keeps only the selected provider', () => {
14 expect(providersFor('chat', { E2E_PROVIDERS: 'grok' })).toEqual(['grok'])
15 })
16
17 test('explicit E2E_PROVIDERS returns no providers when the selection does not support the feature', () => {
18 expect(providersFor('image-gen', { E2E_PROVIDERS: 'elevenlabs' })).toEqual(
19 [],
20 )
21 })
22
23 test('CI chat includes providers outside the local default', () => {
24 const ciChat = providersFor('chat', { CI: '1' })
25 expect(ciChat).toContain('grok')
26 expect(ciChat).toContain('vertex')
27 })
28
29 test('E2E_PROVIDERS=* chat includes providers outside the local default', () => {
30 const allChat = providersFor('chat', { E2E_PROVIDERS: '*' })
31 expect(allChat).toContain('grok')
32 expect(allChat).toContain('vertex')
33 })
34
35 test('unknown E2E_PROVIDERS id throws', () => {
36 expect(() =>
37 providersFor('chat', { E2E_PROVIDERS: 'not-a-provider' }),
38 ).toThrow(/E2E_PROVIDERS has unknown provider\(s\): not-a-provider/)
39 })
40})