Files
llama.cpp/tools/ui/tests/unit/settings-private-fields.test.ts
T
Cristiano Pinto ece963f41b ui: mask API Key field in settings and error splash to stop browser a… (#26562)
* ui: mask API Key field in settings and error splash to stop browser autofill

* ui: set autocomplete=new-password on private fields

The password input type makes browsers offer to save the API key
in the password manager and autofill saved site credentials into
the field. The new-password autocomplete value disables both.

---------

Co-authored-by: Pascal <admin@serveurperso.com>
2026-08-15 22:52:55 +02:00

13 lines
460 B
TypeScript

import { SETTINGS_CHAT_SECTIONS, SETTINGS_KEYS } from '$lib/constants';
import { describe, expect, it } from 'vitest';
describe('checkApiKeyField', () => {
it('should have isPrivate set to true', () => {
const fields = SETTINGS_CHAT_SECTIONS.flatMap((section) => section.fields);
const apiKeyField = fields.find((field) => field?.key === SETTINGS_KEYS.API_KEY);
expect(apiKeyField).toBeDefined();
expect(apiKeyField?.isPrivate).toBe(true);
});
});