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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user