mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-31 11:59:10 +00:00
feat(settings): add searchable navigation
This commit is contained in:
committed by
Carlos Valente
parent
bdd815678b
commit
9e42f18299
@@ -0,0 +1,21 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { matchesSettingsOptionQuery } from '../useAppSettingsMenu';
|
||||
|
||||
describe('matchesSettingsOptionQuery', () => {
|
||||
const option = {
|
||||
id: 'settings__general',
|
||||
label: 'General settings',
|
||||
keywords: ['pin', 'time zone'],
|
||||
};
|
||||
|
||||
it('does not match an empty or whitespace-only query', () => {
|
||||
expect(matchesSettingsOptionQuery(option, '')).toBe(false);
|
||||
expect(matchesSettingsOptionQuery(option, ' ')).toBe(false);
|
||||
});
|
||||
|
||||
it('matches keywords case-insensitively', () => {
|
||||
expect(matchesSettingsOptionQuery(option, 'PIN')).toBe(true);
|
||||
expect(matchesSettingsOptionQuery(option, 'TIME ZONE')).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user