Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

chore(ai): drop comments from the key validation tests

Luis Ortiz6f27ca85f9eb
diff --git a/src/core/capture/ai/__tests__/models.test.ts b/src/core/capture/ai/__tests__/models.test.ts
index a9fde83..98286a2 100644
--- a/src/core/capture/ai/__tests__/models.test.ts
+++ b/src/core/capture/ai/__tests__/models.test.ts
@@ -44,7 +44,6 @@ describe('isCustomModel', () => {
describe('custom model sentinel', () => {
it('is present in every provider as a selectable option', () => {
for (const config of Object.values(AI_PROVIDERS)) {
- // Providers with an empty model list fetch models dynamically
if (config.models.length === 0) continue;
expect(config.models.some((option) => option.id === CUSTOM_MODEL_VALUE)).toBe(true);
}
@@ -57,7 +56,6 @@ describe('custom model sentinel', () => {
describe('every provider default is selectable', () => {
it.each(Object.entries(AI_PROVIDERS))('%s lists its own default model', (_key, config) => {
- // Providers with an empty model list fetch models dynamically at runtime
if (config.models.length === 0) return;
expect(config.models.some((option) => option.id === config.defaultModel)).toBe(true);
});
diff --git a/src/core/capture/ai/__tests__/validate.test.ts b/src/core/capture/ai/__tests__/validate.test.ts
index 9d89a89..3a34f41 100644
--- a/src/core/capture/ai/__tests__/validate.test.ts
+++ b/src/core/capture/ai/__tests__/validate.test.ts
@@ -95,7 +95,7 @@ describe('validateApiKey', () => {
describe('openai with custom base URL (inference probe)', () => {
it('returns rejected when probe returns 401', async () => {
- fetchMock.mockResolvedValueOnce(errorResponse(401)); // chat completions
+ fetchMock.mockResolvedValueOnce(errorResponse(401));
expect(await validateApiKey('openai', 'bad-key', 'https://api.example.com/v1', 'selected-model')).toEqual({
valid: false,
reason: 'rejected',
@@ -147,7 +147,7 @@ describe('validateApiKey', () => {
});
it('returns model-invalid when model is not in catalog', async () => {
- fetchMock.mockResolvedValueOnce(errorResponse(404)); // chat probe fails
+ fetchMock.mockResolvedValueOnce(errorResponse(404));
fetchMock.mockResolvedValueOnce(modelsBody('public-model', 'selected-model'));
expect(await validateApiKey('openai', 'sk-key', 'https://api.example.com/v1', 'not-in-catalog')).toEqual({
valid: false,
@@ -157,7 +157,7 @@ describe('validateApiKey', () => {
});
it('returns model-invalid when model is not in catalog (whitespace)', async () => {
- fetchMock.mockResolvedValueOnce(errorResponse(404)); // chat completions probe fails
+ fetchMock.mockResolvedValueOnce(errorResponse(404));
fetchMock.mockResolvedValueOnce(modelsBody('public-model', 'selected-model'));
expect(await validateApiKey('openai', 'sk-key', 'https://api.example.com/v1', ' missing-model ')).toEqual({
valid: false,
@@ -167,7 +167,7 @@ describe('validateApiKey', () => {
});
it('returns model-invalid when catalog is reachable but model probe fails', async () => {
- fetchMock.mockResolvedValueOnce(errorResponse(404)); // chat completions
+ fetchMock.mockResolvedValueOnce(errorResponse(404));
fetchMock.mockResolvedValueOnce(modelsBody('public-model', 'selected-model'));
expect(await validateApiKey('openai', 'sk-key', 'https://api.example.com/v1', 'missing-model')).toEqual({
valid: false,