mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-31 03:49:11 +00:00
22 lines
688 B
TypeScript
22 lines
688 B
TypeScript
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);
|
|
});
|
|
});
|