refactor(turn): remove dead computeTurnOrderAfterAddition

Zero call sites. Old turn-array addition logic, superseded by 1-list
slotIndexForInit model. Removed func, export, stale comment, and 3
characterization tests that only locked the dead func's behavior.
This commit is contained in:
david raistrick
2026-07-04 17:18:29 -04:00
parent 942545c085
commit 5a09f71d4c
2 changed files with 1 additions and 43 deletions
@@ -6,7 +6,6 @@ const shared = require('@ttrpg/shared');
const {
sortParticipantsByInitiative,
computeTurnOrderAfterRemoval,
computeTurnOrderAfterAddition,
startEncounter,
nextTurn,
togglePause,
@@ -326,26 +325,6 @@ describe('computeTurnOrderAfterRemoval', () => {
});
});
describe('computeTurnOrderAfterAddition', () => {
test('not started = empty', () => {
const out = computeTurnOrderAfterAddition(enc([]), 'a');
expect(out).toEqual({});
});
test('returns insertAt (1-list: caller splices + syncs)', () => {
const e = enc([p('a',3)], { isStarted: true, turnOrderIds: ['a'], participants: [p('a',3)] });
const out = computeTurnOrderAfterAddition(e, 'a');
// already present → no-op
expect(out).toEqual({});
});
test('no-op if already present', () => {
const e = enc([], { isStarted: true, turnOrderIds: ['a', 'b'] });
const out = computeTurnOrderAfterAddition(e, 'a');
expect(out).toEqual({});
});
});
describe('addParticipant', () => {
test('appends participant', () => {
const np = p('z', 7);