Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d7d34db
Add host sessions with read-only PT9 imports (#440)
alex-rawlings-yyc Oct 22, 2026
7c5b657
Keep unreadable draft shards across a repository release
alex-rawlings-yyc Oct 22, 2026
5d5d1cf
Clarify session and analysis repository docs
alex-rawlings-yyc Oct 22, 2026
a64ac26
Add apply with inverse capture and per-session undo (#441)
alex-rawlings-yyc Oct 22, 2026
a11b7b4
Add derived indexes with a rebuild-and-diff command (#442)
alex-rawlings-yyc Oct 22, 2026
7243203
Add token commands with parity tests (#443)
alex-rawlings-yyc Oct 22, 2026
57d0b84
Add morpheme commands with parity tests (#444)
myieye Oct 23, 2026
e3561ee
Pin each keep case and the empty-gloss removal in deleteMorphemes parity
myieye Oct 23, 2026
6c59416
Add apply with inverse capture and per-session undo (#441)
alex-rawlings-yyc Oct 22, 2026
8a50049
Add derived indexes with a rebuild-and-diff command (#442)
alex-rawlings-yyc Oct 22, 2026
f539ff4
Add token commands with parity tests (#443)
alex-rawlings-yyc Oct 22, 2026
e861407
Merge branch '443-token-commands' of https://github.com/sillsdev/inte…
myieye Oct 23, 2026
132a682
Add derived indexes with a rebuild-and-diff command (#442)
alex-rawlings-yyc Oct 23, 2026
9d5b5ef
Add token commands with parity tests (#443)
alex-rawlings-yyc Oct 23, 2026
e33c382
Merge branch '443-token-commands' of https://github.com/sillsdev/inte…
myieye Oct 23, 2026
689bd3c
Add token commands with parity tests (#443)
alex-rawlings-yyc Oct 23, 2026
a7a8a7d
Keep sense refs on gloss rewrites; list the session's language on edit
alex-rawlings-yyc Oct 23, 2026
627c477
Merge branch '443-token-commands' of https://github.com/sillsdev/inte…
myieye Oct 26, 2026
78f8dce
Clarify token-command and change-buffer docs
alex-rawlings-yyc Oct 26, 2026
95d5b64
Merge branch '443-token-commands' of https://github.com/sillsdev/inte…
myieye Oct 26, 2026
1a1ce09
Merge branch 'main' into 444-morpheme-commands
myieye Oct 26, 2026
9a16e1a
Share parity test fixtures and assertions through parity.ts
myieye Oct 26, 2026
d00c86e
Merge remote-tracking branch 'origin/main' into 444-morpheme-commands
myieye Oct 27, 2026
e42e08e
Pin that a blank morpheme gloss write keeps the sense ref
myieye Oct 27, 2026
1988741
State the morpheme wrappers' throw conditions; split detachEmptiedAna…
myieye Oct 27, 2026
dc65b21
Match the sibling wrappers' @throws wording
myieye Oct 27, 2026
8e0aef4
Merge remote-tracking branch 'origin/main' into 444-morpheme-commands
imnasnainaec Oct 27, 2026
3099d58
Share parity fixtures across the command parity tests
imnasnainaec Oct 27, 2026
5faf23a
Merge remote-tracking branch 'origin/main' into 444-morpheme-commands
imnasnainaec Oct 27, 2026
061ba9e
Clarify morpheme command docs; state session-edit throws in full
alex-rawlings-yyc Oct 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
269 changes: 193 additions & 76 deletions src/__tests__/main.test.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import { writeSegmentFreeTranslation as writeCommand } from '../../../services/c
import { writeSegmentFreeTranslation } from '../../../store/analysisSlice';
import { emptyAnalysis } from '../../../types/empty-factories';
import { FIXTURE_STAMPS } from '../../test-helpers';
import { runParity } from './parity';
import { ids, LATER, NOW, type ParityCase, runParity } from './parity';

const NOW = '2026-06-01T00:00:00.000Z';
const LATER = { createdAt: '2026-03-01T00:00:00.000Z', updatedAt: '2026-03-01T00:00:00.000Z' };
const NEW = { linkId: 'new-link', analysisId: 'new-analysis' };

const SEGMENT = 'GEN 1:1';
Expand All @@ -34,8 +32,6 @@ function analysisOf(
return { ...emptyAnalysis(), segmentAnalyses, segmentAnalysisLinks };
}

const ids = (records: readonly { id: string }[]) => records.map(({ id }) => id).sort();

const translationOf = (store: TextAnalysis, id: string) =>
store.segmentAnalyses.find((sa) => sa.id === id);

Expand All @@ -44,15 +40,8 @@ const linkOf = (store: TextAnalysis, id: string) =>

type WriteInput = { value: string; adoptStaleAnalysisId?: string };

type ParityCase = {
analysis: TextAnalysis;
input: WriteInput;
/** What the reducer's result must show, so the case exercises the path it names. */
expectStore: (store: TextAnalysis) => void;
};

describe('writeSegmentFreeTranslation parity with the reducer', () => {
const cases: [string, ParityCase][] = [
const cases: [string, ParityCase<WriteInput>][] = [
[
'makes an approved translation for a segment with none',
{
Expand Down
Loading
Loading