25 lines
987 B
JavaScript
25 lines
987 B
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
|
|
import { matchesSessionQuery } from '../src/search.js';
|
|
|
|
const session = {
|
|
id: 'ABCDEF12-3456-7890-ABCD-EF1234567890',
|
|
summary: 'Fix OAuth Callback',
|
|
cwd: '/home/user/IdeaProjects/AgentManager',
|
|
custom_name: 'Release API Review',
|
|
};
|
|
|
|
test('session search ignores letter case in standard fields', () => {
|
|
assert.equal(matchesSessionQuery(session, 'oauth'), true);
|
|
assert.equal(matchesSessionQuery(session, 'OAUTH'), true);
|
|
assert.equal(matchesSessionQuery(session, 'ideaprojects'), true);
|
|
assert.equal(matchesSessionQuery(session, 'abcdef12'), true);
|
|
});
|
|
|
|
test('session search ignores letter case in custom names when enabled', () => {
|
|
assert.equal(matchesSessionQuery(session, 'release api', { includeCustomName: true }), true);
|
|
assert.equal(matchesSessionQuery(session, 'RELEASE API', { includeCustomName: true }), true);
|
|
assert.equal(matchesSessionQuery(session, 'release api'), false);
|
|
});
|