1 import { matchChunks } from './match-chunks';
3 describe('getItemNameSearchChunks', () => {
4 test('should return empty array if no search term', () => {
5 expect(matchChunks('', '')).toEqual([]);
8 test('should not match if no term matches', () => {
9 expect(matchChunks('my secure notes', 'nothing')).toEqual([]);
12 test('should return a single item with a correct match', () => {
13 expect(matchChunks('my secure notes', 'my')).toEqual([
21 test('should return all items with correct matches', () => {
22 expect(matchChunks('my secure notes', 'my notes')).toEqual([
34 test('should return all items with correct matches in any order', () => {
35 expect(matchChunks('my secure notes', 'notes my')).toEqual([
47 test('should match partial terms', () => {
48 expect(matchChunks('my secure notes', 'my sec')).toEqual([
60 test('should be case-insensitive', () => {
61 expect(matchChunks('my secure notes', 'My SEc')).toEqual([