mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-08-27 15:41:19 +02:00
ece963f41b
* 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>
13 lines
460 B
TypeScript
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);
|
|
});
|
|
});
|