feat: ship Wave 5-6 multi-surface hygiene, optimization, and bug fixes
This commit is contained in:
parent
01ef3293cf
commit
66b6b45ba9
399 changed files with 17828 additions and 11330 deletions
|
|
@ -1,129 +1,134 @@
|
|||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { ErrorCode } from '@d3ro/core/errors'
|
||||
import type { History, MeetingMemoRow, MeetingSessionRow } from '../../../src/main/db/schema'
|
||||
import {
|
||||
bindTestDatabase,
|
||||
unbindTestDatabase,
|
||||
} from '../../../src/main/db'
|
||||
import {
|
||||
history,
|
||||
meetingMemos,
|
||||
meetingSessions,
|
||||
type NewHistory,
|
||||
type NewMeetingMemoRow,
|
||||
type NewMeetingSessionRow,
|
||||
} from '../../../src/main/db/schema'
|
||||
import {
|
||||
createUnifiedSearchExcerpt,
|
||||
getUnifiedSearchService,
|
||||
normalizeUnifiedSearchQuery,
|
||||
resetUnifiedSearchServiceForTests,
|
||||
} from '../../../src/main/services/UnifiedSearchService'
|
||||
import { createTestDb } from '../../helpers/createTestDb'
|
||||
|
||||
interface MockBuilderOptions {
|
||||
get?: unknown
|
||||
all?: unknown[]
|
||||
error?: Error
|
||||
}
|
||||
|
||||
function createMockBuilder(options: MockBuilderOptions = {}) {
|
||||
const builder = {
|
||||
from: vi.fn(),
|
||||
where: vi.fn(),
|
||||
orderBy: vi.fn(),
|
||||
limit: vi.fn(),
|
||||
get: vi.fn(),
|
||||
all: vi.fn(),
|
||||
function makeHistoryRow(overrides: Partial<NewHistory> & { id: string }): NewHistory {
|
||||
return {
|
||||
title: '제품 메모',
|
||||
originalText: '초기 원문',
|
||||
polishedText: '다음 분기 출시 계획을 정리했습니다.',
|
||||
focusedApp: null,
|
||||
focusedAppName: null,
|
||||
focusedAppWindowTitle: null,
|
||||
mode: 'dictation',
|
||||
status: 'completed',
|
||||
errorCode: null,
|
||||
audioLocalPath: null,
|
||||
duration: 10,
|
||||
detectedLanguage: 'ko',
|
||||
micDevice: null,
|
||||
wordCount: 6,
|
||||
sttModel: null,
|
||||
llmModel: null,
|
||||
sttLatencyMs: null,
|
||||
llmLatencyMs: null,
|
||||
createdAt: 100,
|
||||
updatedAt: 100,
|
||||
appVersion: '1.9.0',
|
||||
summaryText: null,
|
||||
isFavorite: false,
|
||||
...overrides,
|
||||
}
|
||||
builder.from.mockImplementation(() => {
|
||||
if (options.error !== undefined) throw options.error
|
||||
return builder
|
||||
})
|
||||
builder.where.mockReturnValue(builder)
|
||||
builder.orderBy.mockReturnValue(builder)
|
||||
builder.limit.mockReturnValue(builder)
|
||||
builder.get.mockReturnValue(options.get ?? null)
|
||||
builder.all.mockReturnValue(options.all ?? [])
|
||||
return builder
|
||||
}
|
||||
|
||||
const selectQueue: ReturnType<typeof createMockBuilder>[] = []
|
||||
const mockDb = {
|
||||
select: vi.fn(() => selectQueue.shift() ?? createMockBuilder()),
|
||||
function makeMeetingRow(
|
||||
overrides: Partial<NewMeetingSessionRow> & { id: string },
|
||||
): NewMeetingSessionRow {
|
||||
return {
|
||||
title: '주간 회의',
|
||||
status: 'completed',
|
||||
startedAt: 200,
|
||||
endedAt: 300,
|
||||
durationMs: 100,
|
||||
rawTranscript: '출시 계획을 다음 주에 검토합니다.',
|
||||
editedTranscript: null,
|
||||
minutesMarkdown: null,
|
||||
minutesJson: null,
|
||||
sttModel: null,
|
||||
llmModel: null,
|
||||
sttLatencyMs: null,
|
||||
llmLatencyMs: null,
|
||||
errorMessage: null,
|
||||
createdAt: 200,
|
||||
updatedAt: 300,
|
||||
...overrides,
|
||||
}
|
||||
}
|
||||
|
||||
vi.mock('../../../src/main/db', () => ({
|
||||
getDatabase: () => mockDb,
|
||||
}))
|
||||
|
||||
vi.mock('../../../src/main/services/LoggerService', () => ({
|
||||
getLogger: () => ({
|
||||
info: vi.fn(),
|
||||
warn: vi.fn(),
|
||||
error: vi.fn(),
|
||||
debug: vi.fn(),
|
||||
}),
|
||||
}))
|
||||
|
||||
const record: History = {
|
||||
id: 'record-1',
|
||||
title: '제품 메모',
|
||||
originalText: '초기 원문',
|
||||
polishedText: '다음 분기 출시 계획을 정리했습니다.',
|
||||
focusedApp: null,
|
||||
focusedAppName: null,
|
||||
focusedAppWindowTitle: null,
|
||||
mode: 'dictation',
|
||||
status: 'completed',
|
||||
errorCode: null,
|
||||
audioLocalPath: null,
|
||||
duration: 10,
|
||||
detectedLanguage: 'ko',
|
||||
micDevice: null,
|
||||
wordCount: 6,
|
||||
sttModel: null,
|
||||
llmModel: null,
|
||||
sttLatencyMs: null,
|
||||
llmLatencyMs: null,
|
||||
createdAt: 100,
|
||||
updatedAt: 100,
|
||||
appVersion: '1.9.0',
|
||||
summaryText: null,
|
||||
isFavorite: false,
|
||||
}
|
||||
|
||||
const meeting: MeetingSessionRow = {
|
||||
id: 'meeting-1',
|
||||
title: '주간 회의',
|
||||
status: 'completed',
|
||||
startedAt: 200,
|
||||
endedAt: 300,
|
||||
durationMs: 100,
|
||||
rawTranscript: '출시 계획을 다음 주에 검토합니다.',
|
||||
editedTranscript: null,
|
||||
minutesMarkdown: null,
|
||||
minutesJson: null,
|
||||
sttModel: null,
|
||||
llmModel: null,
|
||||
sttLatencyMs: null,
|
||||
llmLatencyMs: null,
|
||||
errorMessage: null,
|
||||
createdAt: 200,
|
||||
updatedAt: 300,
|
||||
function makeMemoRow(
|
||||
overrides: Partial<NewMeetingMemoRow> & { id: string; sessionId: string },
|
||||
): NewMeetingMemoRow {
|
||||
return {
|
||||
content: '기본 메모 내용',
|
||||
timestampMs: 10_000,
|
||||
revision: 1,
|
||||
createdAt: 210,
|
||||
updatedAt: 210,
|
||||
...overrides,
|
||||
}
|
||||
}
|
||||
|
||||
describe('UnifiedSearchService', () => {
|
||||
let closeDb: (() => void) | null = null
|
||||
|
||||
function useFreshTestDb() {
|
||||
const testDb = createTestDb()
|
||||
closeDb = testDb.close
|
||||
bindTestDatabase(testDb.db)
|
||||
return testDb
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
selectQueue.length = 0
|
||||
vi.clearAllMocks()
|
||||
resetUnifiedSearchServiceForTests()
|
||||
unbindTestDatabase()
|
||||
})
|
||||
|
||||
it('normalizes input and creates a bounded excerpt around the match', async () => {
|
||||
const { createUnifiedSearchExcerpt, normalizeUnifiedSearchQuery } = await import(
|
||||
'../../../src/main/services/UnifiedSearchService'
|
||||
)
|
||||
afterEach(() => {
|
||||
resetUnifiedSearchServiceForTests()
|
||||
unbindTestDatabase()
|
||||
if (closeDb) {
|
||||
closeDb()
|
||||
closeDb = null
|
||||
}
|
||||
vi.restoreAllMocks()
|
||||
})
|
||||
|
||||
it('normalizes input and creates a bounded excerpt around the match', () => {
|
||||
expect(normalizeUnifiedSearchQuery(' 출시\n 계획 ')).toBe('출시 계획')
|
||||
expect(normalizeUnifiedSearchQuery('a'.repeat(250))).toHaveLength(200)
|
||||
expect(normalizeUnifiedSearchQuery(` ${'a'.repeat(199)} b`)).toBe('a'.repeat(199))
|
||||
const excerpt = createUnifiedSearchExcerpt(`앞부분 ${'x'.repeat(80)} 출시 계획 ${'y'.repeat(80)}`, '출시 계획', 60)
|
||||
const excerpt = createUnifiedSearchExcerpt(
|
||||
`앞부분 ${'x'.repeat(80)} 출시 계획 ${'y'.repeat(80)}`,
|
||||
'출시 계획',
|
||||
60,
|
||||
)
|
||||
expect(excerpt).toContain('출시 계획')
|
||||
expect(excerpt.startsWith('…')).toBe(true)
|
||||
expect(excerpt.endsWith('…')).toBe(true)
|
||||
})
|
||||
|
||||
it('merges records and meeting transcripts by occurrence time and preserves source ids', async () => {
|
||||
selectQueue.push(
|
||||
createMockBuilder({ get: { count: 1 } }),
|
||||
createMockBuilder({ all: [record] }),
|
||||
createMockBuilder({ get: { count: 1 } }),
|
||||
createMockBuilder({ all: [meeting] }),
|
||||
)
|
||||
const { getUnifiedSearchService, resetUnifiedSearchServiceForTests } = await import(
|
||||
'../../../src/main/services/UnifiedSearchService'
|
||||
)
|
||||
resetUnifiedSearchServiceForTests()
|
||||
it('merges records and meeting transcripts by occurrence time and preserves source ids', () => {
|
||||
const { db } = useFreshTestDb()
|
||||
db.insert(history).values(makeHistoryRow({ id: 'record-1', createdAt: 100, updatedAt: 100 })).run()
|
||||
db.insert(meetingSessions).values(makeMeetingRow({ id: 'meeting-1', startedAt: 200, createdAt: 200 })).run()
|
||||
|
||||
const response = getUnifiedSearchService().search({ query: '계획', limit: 10 })
|
||||
|
||||
|
|
@ -139,17 +144,12 @@ describe('UnifiedSearchService', () => {
|
|||
expect(response.results[1]).toMatchObject({ matchedField: 'content' })
|
||||
})
|
||||
|
||||
it('returns immediately for an empty query', async () => {
|
||||
const { getUnifiedSearchService, resetUnifiedSearchServiceForTests } = await import(
|
||||
'../../../src/main/services/UnifiedSearchService'
|
||||
)
|
||||
resetUnifiedSearchServiceForTests()
|
||||
it('returns immediately for an empty query without opening DB', () => {
|
||||
expect(getUnifiedSearchService().search({ query: ' ' })).toEqual({
|
||||
query: '',
|
||||
results: [],
|
||||
total: 0,
|
||||
})
|
||||
expect(mockDb.select).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it.each([
|
||||
|
|
@ -160,58 +160,43 @@ describe('UnifiedSearchService', () => {
|
|||
{ query: '계획', limit: Number.NaN },
|
||||
{ query: '계획', limit: Number.POSITIVE_INFINITY },
|
||||
{ query: '계획', limit: '10' },
|
||||
])('rejects malformed runtime parameters with ConfigInvalidValue: %o', async (params) => {
|
||||
const { getUnifiedSearchService, resetUnifiedSearchServiceForTests } = await import(
|
||||
'../../../src/main/services/UnifiedSearchService'
|
||||
)
|
||||
resetUnifiedSearchServiceForTests()
|
||||
|
||||
])('rejects malformed runtime parameters with ConfigInvalidValue: %o', (params) => {
|
||||
expect(() => getUnifiedSearchService().search(params)).toThrowError(
|
||||
expect.objectContaining({ code: ErrorCode.ConfigInvalidValue }),
|
||||
)
|
||||
expect(mockDb.select).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('maps database failures to the IPC error contract', async () => {
|
||||
selectQueue.push(createMockBuilder({ error: new Error('database unavailable') }))
|
||||
const { getUnifiedSearchService, resetUnifiedSearchServiceForTests } = await import(
|
||||
'../../../src/main/services/UnifiedSearchService'
|
||||
)
|
||||
resetUnifiedSearchServiceForTests()
|
||||
it('maps database failures to the IPC error contract', () => {
|
||||
expect(() => getUnifiedSearchService().search({ query: '계획' })).toThrowError(
|
||||
expect.objectContaining({ code: ErrorCode.DBQueryFailed }),
|
||||
)
|
||||
})
|
||||
|
||||
it('includes meeting_memos and timed transcript segments in meeting search results', async () => {
|
||||
const memoOnlyMeeting: MeetingSessionRow = {
|
||||
...meeting,
|
||||
id: 'meeting-memo-1',
|
||||
title: '설계 검토 회의',
|
||||
startedAt: 400,
|
||||
createdAt: 400,
|
||||
rawTranscript: '[00:10] 아키텍처 개요 설명',
|
||||
}
|
||||
const memoRow: MeetingMemoRow = {
|
||||
id: 'memo-1',
|
||||
sessionId: 'meeting-memo-1',
|
||||
content: '마이그레이션 체크리스트 확인 필요',
|
||||
timestampMs: 75_000,
|
||||
createdAt: 410,
|
||||
updatedAt: 410,
|
||||
}
|
||||
selectQueue.push(
|
||||
createMockBuilder({ get: { count: 0 } }),
|
||||
createMockBuilder({ all: [] }),
|
||||
createMockBuilder({ get: { count: 0 } }),
|
||||
createMockBuilder({ all: [] }),
|
||||
createMockBuilder({ all: [memoRow] }),
|
||||
createMockBuilder({ all: [memoOnlyMeeting] }),
|
||||
)
|
||||
const { getUnifiedSearchService, resetUnifiedSearchServiceForTests } = await import(
|
||||
'../../../src/main/services/UnifiedSearchService'
|
||||
)
|
||||
resetUnifiedSearchServiceForTests()
|
||||
it('includes meeting_memos and timed transcript segments in meeting search results', () => {
|
||||
const { db } = useFreshTestDb()
|
||||
db.insert(meetingSessions)
|
||||
.values(
|
||||
makeMeetingRow({
|
||||
id: 'meeting-memo-1',
|
||||
title: '설계 검토 회의',
|
||||
startedAt: 400,
|
||||
createdAt: 400,
|
||||
rawTranscript: '[00:10] 아키텍처 개요 설명',
|
||||
}),
|
||||
)
|
||||
.run()
|
||||
db.insert(meetingMemos)
|
||||
.values(
|
||||
makeMemoRow({
|
||||
id: 'memo-1',
|
||||
sessionId: 'meeting-memo-1',
|
||||
content: '마이그레이션 체크리스트 확인 필요',
|
||||
timestampMs: 75_000,
|
||||
createdAt: 410,
|
||||
updatedAt: 410,
|
||||
}),
|
||||
)
|
||||
.run()
|
||||
|
||||
const response = getUnifiedSearchService().search({ query: '체크리스트', limit: 10 })
|
||||
|
||||
|
|
@ -226,4 +211,246 @@ describe('UnifiedSearchService', () => {
|
|||
}),
|
||||
])
|
||||
})
|
||||
|
||||
it('search_oldLongMeetingMemoVsRecentShortMeeting_prioritizesRecentMeetingAndCreatedAtMemo', () => {
|
||||
const { db } = useFreshTestDb()
|
||||
// Old long meeting: high timestampMs (2 hours in), early createdAt/startedAt
|
||||
db.insert(meetingSessions)
|
||||
.values([
|
||||
makeMeetingRow({
|
||||
id: 'old-long-meeting',
|
||||
title: '과거 장기 회의',
|
||||
startedAt: 100,
|
||||
createdAt: 100,
|
||||
rawTranscript: '잡담 내용',
|
||||
}),
|
||||
makeMeetingRow({
|
||||
id: 'recent-short-meeting',
|
||||
title: '최신 짧은 회의',
|
||||
startedAt: 900,
|
||||
createdAt: 900,
|
||||
rawTranscript: '일반 진행 상황',
|
||||
}),
|
||||
])
|
||||
.run()
|
||||
|
||||
db.insert(meetingMemos)
|
||||
.values([
|
||||
makeMemoRow({
|
||||
id: 'old-late-offset-memo',
|
||||
sessionId: 'old-long-meeting',
|
||||
content: '로드맵 1차 초안 메모',
|
||||
timestampMs: 7_200_000,
|
||||
createdAt: 110,
|
||||
updatedAt: 110,
|
||||
}),
|
||||
makeMemoRow({
|
||||
id: 'recent-early-offset-memo',
|
||||
sessionId: 'recent-short-meeting',
|
||||
content: '로드맵 최신 결정사항',
|
||||
timestampMs: 5_000,
|
||||
createdAt: 910,
|
||||
updatedAt: 910,
|
||||
}),
|
||||
makeMemoRow({
|
||||
id: 'recent-earlier-created-memo',
|
||||
sessionId: 'recent-short-meeting',
|
||||
content: '로드맵 중간 메모',
|
||||
timestampMs: 60_000,
|
||||
createdAt: 905,
|
||||
updatedAt: 905,
|
||||
}),
|
||||
])
|
||||
.run()
|
||||
|
||||
const limited = getUnifiedSearchService().search({ query: '로드맵', limit: 1 })
|
||||
expect(limited.total).toBe(2)
|
||||
expect(limited.results.map((r) => r.id)).toEqual(['recent-short-meeting'])
|
||||
expect(limited.results[0].excerpt).toBe('[00:05] 로드맵 최신 결정사항')
|
||||
})
|
||||
|
||||
it('search_meetingStartedAtDiffersFromCreatedAt_ordersByStartedAt', () => {
|
||||
const { db } = useFreshTestDb()
|
||||
db.insert(meetingSessions)
|
||||
.values([
|
||||
makeMeetingRow({
|
||||
id: 'older-started-imported-later',
|
||||
title: '과거 회의 사후 동기화',
|
||||
startedAt: 500,
|
||||
createdAt: 950,
|
||||
rawTranscript: '분기 목표 리뷰',
|
||||
}),
|
||||
makeMeetingRow({
|
||||
id: 'newer-started-created-earlier',
|
||||
title: '최근 회의',
|
||||
startedAt: 800,
|
||||
createdAt: 200,
|
||||
rawTranscript: '분기 목표 확정',
|
||||
}),
|
||||
])
|
||||
.run()
|
||||
|
||||
const limited = getUnifiedSearchService().search({ query: '분기 목표', limit: 1 })
|
||||
expect(limited.total).toBe(2)
|
||||
expect(limited.results[0].id).toBe('newer-started-created-earlier')
|
||||
expect(limited.results[0].occurredAt).toBe(800)
|
||||
})
|
||||
|
||||
it('search_meetingMatchesDirectlyOutsideLimitAndViaMemos_countsDistinctTotalWithoutDoubleCounting', () => {
|
||||
const { db } = useFreshTestDb()
|
||||
db.insert(history)
|
||||
.values(
|
||||
makeHistoryRow({
|
||||
id: 'hist-overlap',
|
||||
title: '아키텍처 기록',
|
||||
polishedText: '아키텍처 변경 공지',
|
||||
createdAt: 1_000,
|
||||
updatedAt: 1_000,
|
||||
}),
|
||||
)
|
||||
.run()
|
||||
|
||||
db.insert(meetingSessions)
|
||||
.values([
|
||||
makeMeetingRow({
|
||||
id: 'meet-both-recent',
|
||||
title: '아키텍처 위원회',
|
||||
startedAt: 900,
|
||||
createdAt: 900,
|
||||
rawTranscript: '아키텍처 리뷰',
|
||||
}),
|
||||
makeMeetingRow({
|
||||
id: 'meet-both-old-outside-limit',
|
||||
title: '초기 아키텍처 회의',
|
||||
startedAt: 100,
|
||||
createdAt: 100,
|
||||
rawTranscript: '아키텍처 설계 초안',
|
||||
}),
|
||||
makeMeetingRow({
|
||||
id: 'meet-memo-only-1',
|
||||
title: '일반 스탠드업 1',
|
||||
startedAt: 700,
|
||||
createdAt: 700,
|
||||
rawTranscript: '진행 보고',
|
||||
}),
|
||||
makeMeetingRow({
|
||||
id: 'meet-memo-only-2',
|
||||
title: '일반 스탠드업 2',
|
||||
startedAt: 600,
|
||||
createdAt: 600,
|
||||
rawTranscript: '진행 보고',
|
||||
}),
|
||||
])
|
||||
.run()
|
||||
|
||||
db.insert(meetingMemos)
|
||||
.values([
|
||||
makeMemoRow({
|
||||
id: 'memo-m1',
|
||||
sessionId: 'meet-both-recent',
|
||||
content: '아키텍처 메모 1',
|
||||
createdAt: 905,
|
||||
}),
|
||||
makeMemoRow({
|
||||
id: 'memo-m2',
|
||||
sessionId: 'meet-both-old-outside-limit',
|
||||
content: '아키텍처 메모 2',
|
||||
createdAt: 950,
|
||||
}),
|
||||
makeMemoRow({
|
||||
id: 'memo-m3a',
|
||||
sessionId: 'meet-memo-only-1',
|
||||
content: '아키텍처 후속 과제 A',
|
||||
createdAt: 710,
|
||||
}),
|
||||
makeMemoRow({
|
||||
id: 'memo-m3b',
|
||||
sessionId: 'meet-memo-only-1',
|
||||
content: '아키텍처 후속 과제 B',
|
||||
createdAt: 720,
|
||||
}),
|
||||
makeMemoRow({
|
||||
id: 'memo-m4',
|
||||
sessionId: 'meet-memo-only-2',
|
||||
content: '아키텍처 후속 과제 C',
|
||||
createdAt: 610,
|
||||
}),
|
||||
])
|
||||
.run()
|
||||
|
||||
const response = getUnifiedSearchService().search({ query: '아키텍처', limit: 1 })
|
||||
// 1 history + 4 distinct meetingSessions = 5 total, even though limit is 1 and meet-both-old matches both directly and via memo
|
||||
expect(response.results).toHaveLength(1)
|
||||
expect(response.total).toBe(5)
|
||||
})
|
||||
|
||||
it('search_ftsTablesAbsent_fallsBackToLikeFilteringSafely', () => {
|
||||
const { db, sqlite } = useFreshTestDb()
|
||||
db.insert(history)
|
||||
.values(
|
||||
makeHistoryRow({
|
||||
id: 'hist-legacy',
|
||||
title: '레거시 노트',
|
||||
polishedText: '트라이그램 없는 데이터베이스 검색 테스트',
|
||||
createdAt: 300,
|
||||
updatedAt: 300,
|
||||
}),
|
||||
)
|
||||
.run()
|
||||
db.insert(meetingSessions)
|
||||
.values(
|
||||
makeMeetingRow({
|
||||
id: 'meet-legacy',
|
||||
title: '레거시 회의',
|
||||
startedAt: 400,
|
||||
createdAt: 400,
|
||||
rawTranscript: '일반 회의록',
|
||||
}),
|
||||
)
|
||||
.run()
|
||||
db.insert(meetingMemos)
|
||||
.values(
|
||||
makeMemoRow({
|
||||
id: 'memo-legacy',
|
||||
sessionId: 'meet-legacy',
|
||||
content: '데이터베이스 백업 메모',
|
||||
createdAt: 410,
|
||||
}),
|
||||
)
|
||||
.run()
|
||||
|
||||
sqlite.exec('DROP TABLE IF EXISTS history_fts')
|
||||
sqlite.exec('DROP TABLE IF EXISTS meeting_sessions_fts')
|
||||
sqlite.exec('DROP TABLE IF EXISTS meeting_memos_fts')
|
||||
|
||||
const response = getUnifiedSearchService().search({ query: '데이터베이스', limit: 10 })
|
||||
expect(response.total).toBe(2)
|
||||
expect(response.results.map((r) => r.id)).toEqual(['meet-legacy', 'hist-legacy'])
|
||||
})
|
||||
|
||||
it('search_ftsMatchThrowsAtRuntime_fallsBackToLikeFilteringSafely', () => {
|
||||
const { db, sqlite } = useFreshTestDb()
|
||||
db.insert(history)
|
||||
.values(
|
||||
makeHistoryRow({
|
||||
id: 'hist-fts-broken',
|
||||
title: '복구 테스트',
|
||||
polishedText: '인덱스 손상 복구 검증',
|
||||
createdAt: 500,
|
||||
updatedAt: 500,
|
||||
}),
|
||||
)
|
||||
.run()
|
||||
|
||||
// Replace history_fts with a plain non-FTS table so sqlite_master reports it exists, causing MATCH to fail at runtime
|
||||
sqlite.exec('DROP TRIGGER IF EXISTS history_fts_ai')
|
||||
sqlite.exec('DROP TRIGGER IF EXISTS history_fts_au')
|
||||
sqlite.exec('DROP TRIGGER IF EXISTS history_fts_ad')
|
||||
sqlite.exec('DROP TABLE history_fts')
|
||||
sqlite.exec('CREATE TABLE history_fts (row_id TEXT)')
|
||||
|
||||
const response = getUnifiedSearchService().search({ query: '손상 복구', limit: 10 })
|
||||
expect(response.total).toBe(1)
|
||||
expect(response.results.map((r) => r.id)).toEqual(['hist-fts-broken'])
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue