@@ -175,13 +175,13 @@ test('promoteSuggestionMisses posts miss_ids with an optional lang/intent overri
|
||||
&& $request->body() === json_encode(['miss_ids' => [1, 2], 'lang' => 'my']));
|
||||
});
|
||||
|
||||
test('syncSuggestions triggers a sync-chroma job and returns the job id', function () use ($config) {
|
||||
test('syncSuggestions triggers a sync job and returns the job id', function () use ($config) {
|
||||
Http::fake(['bnfexpress.test/*' => Http::response(['job_id' => 'abc-123'], 202)]);
|
||||
|
||||
$result = (new BnfexpressAdminClient($config))->syncSuggestions();
|
||||
|
||||
expect($result)->toBe(['job_id' => 'abc-123']);
|
||||
Http::assertSent(fn ($request) => $request->url() === 'https://bnfexpress.test/admin/suggestions/sync-chroma'
|
||||
Http::assertSent(fn ($request) => $request->url() === 'https://bnfexpress.test/admin/suggestions/sync'
|
||||
&& $request->method() === 'POST');
|
||||
});
|
||||
|
||||
@@ -191,7 +191,7 @@ test('getSuggestionSyncStatus polls the job status endpoint', function () use ($
|
||||
$result = (new BnfexpressAdminClient($config))->getSuggestionSyncStatus('abc-123');
|
||||
|
||||
expect($result)->toBe(['status' => 'finished', 'result' => ['synced' => 3]]);
|
||||
Http::assertSent(fn ($request) => $request->url() === 'https://bnfexpress.test/admin/suggestions/sync-chroma/abc-123'
|
||||
Http::assertSent(fn ($request) => $request->url() === 'https://bnfexpress.test/admin/suggestions/sync/abc-123'
|
||||
&& $request->method() === 'GET');
|
||||
});
|
||||
|
||||
@@ -201,8 +201,8 @@ test('deleteSuggestionEmbedding signs a bodyless DELETE request', function () us
|
||||
(new BnfexpressAdminClient($config))->deleteSuggestionEmbedding(5);
|
||||
|
||||
Http::assertSent(function ($request) use ($config) {
|
||||
return $request->url() === 'https://bnfexpress.test/admin/suggestions/5/chroma'
|
||||
return $request->url() === 'https://bnfexpress.test/admin/suggestions/5/embedding'
|
||||
&& $request->method() === 'DELETE'
|
||||
&& assertSignedCorrectly($request, 'DELETE', '/admin/suggestions/5/chroma', '', $config['client_secret']);
|
||||
&& assertSignedCorrectly($request, 'DELETE', '/admin/suggestions/5/embedding', '', $config['client_secret']);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user