sync: update from private repo (9a86f49b)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { CONFIG_GROUPS } from './SettingsSidebar';
|
||||
import { buildSettingsSearchIndex, searchSettings } from './settingsSearchIndex';
|
||||
import { buildSettingsFieldSearchIndex, buildSettingsSearchIndex, searchSettings } from './settingsSearchIndex';
|
||||
|
||||
describe('searchSettings', () => {
|
||||
it('finds a section by a config-key keyword buried in a form', () => {
|
||||
@@ -37,6 +37,15 @@ describe('searchSettings', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('field search index', () => {
|
||||
it('finds a fixed field by its config key and keeps the target section', () => {
|
||||
const results = searchSettings('searxng_url', buildSettingsFieldSearchIndex());
|
||||
expect(results).toEqual(expect.arrayContaining([
|
||||
expect.objectContaining({ sectionId: 'tools-web', fieldId: 'tools.searxngUrl' }),
|
||||
]));
|
||||
});
|
||||
});
|
||||
|
||||
describe('index integrity (drift guard)', () => {
|
||||
const allIds = CONFIG_GROUPS.flatMap(g => g.sections.map(s => s.id));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user