Skip to content

Commit 21fee3f

Browse files
committed
fix: align gateway auth/catalog tests with non-managed providers
Update auth summary expectations for the ready/models_ready schema and retarget provider refresh fixtures away from removed managed slots.
1 parent ba340f1 commit 21fee3f

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎packages/agent-gateway/test/auth.test.ts‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,11 @@ describe('server-v2 GET /api/v1/auth', () => {
6060

6161
it('returns models_ready=false with an empty snapshot on empty config', async () => {
6262
await boot();
63-
expect(await getAuth()).toEqual({
63+
expect(await getAuth()).toMatchObject({
64+
ready: false,
6465
models_ready: false,
6566
providers_count: 0,
66-
managed_provider: null,
67+
default_model: null,
6768
});
6869
});
6970

@@ -73,7 +74,7 @@ describe('server-v2 GET /api/v1/auth', () => {
7374
'default_model = "x"',
7475
'',
7576
'[providers.x]',
76-
'type = "pythinker"',
77+
'type = "openai"',
7778
'api_key = "sk-test"',
7879
'',
7980
'[models.x]',
@@ -83,18 +84,18 @@ describe('server-v2 GET /api/v1/auth', () => {
8384
'',
8485
].join('\n'),
8586
);
86-
expect(await getAuth()).toEqual({
87+
expect(await getAuth()).toMatchObject({
88+
ready: true,
8789
models_ready: true,
8890
providers_count: 1,
89-
managed_provider: null,
9091
});
9192
});
9293

9394
it('returns models_ready=false when a provider exists but default_model is missing', async () => {
9495
await boot(
9596
[
9697
'[providers.x]',
97-
'type = "pythinker"',
98+
'type = "openai"',
9899
'api_key = "sk-test"',
99100
'',
100101
'[models.x]',
@@ -115,7 +116,7 @@ describe('server-v2 GET /api/v1/auth', () => {
115116
'default_model = "gone"',
116117
'',
117118
'[providers.x]',
118-
'type = "pythinker"',
119+
'type = "openai"',
119120
'api_key = "sk-test"',
120121
'',
121122
'[models.x]',
@@ -153,7 +154,7 @@ describe('server-v2 GET /api/v1/auth', () => {
153154
await boot(
154155
[
155156
'[providers."openai"]',
156-
'type = "pythinker"',
157+
'type = "openai"',
157158
'base_url = "https://example.test/v1"',
158159
'',
159160
'[providers."openai".oauth]',

‎packages/agent-gateway/test/modelCatalog.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ describe('server-v2 /api/v1 model/provider catalog', () => {
372372
const seeds = [[IProviderDiscoveryService, discoveryStub(refreshProviderModels)]] as unknown as ScopeSeed;
373373
await boot(CATALOG_TOML, seeds);
374374

375-
const { status, body } = await postJson('/api/v1/providers/managed%3Apythinker-code:refresh', {});
375+
const { status, body } = await postJson('/api/v1/providers/openai:refresh', {});
376376
expect(status).toBe(200);
377377
expect(body.code).toBe(0);
378378
expect(refreshProviderModels).toHaveBeenCalledWith({ providerId: 'openai' });

0 commit comments

Comments
 (0)