feat(state): automation fields on action view model
This commit is contained in:
@@ -239,6 +239,39 @@ describe('action columns projection', () => {
|
||||
expect(rest?.loopEnabled).toBe(true);
|
||||
});
|
||||
|
||||
it('marks automationUnlocked on actions after manual completion', () => {
|
||||
const state = createGameState(content);
|
||||
state.manualCompletionCounts.gather_supplies = 1;
|
||||
const view = toView(state, content);
|
||||
const gather = view.actionColumns
|
||||
.flatMap((c) => c.groups)
|
||||
.flatMap((g) => g.actions)
|
||||
.find((a) => a.id === 'gather_supplies');
|
||||
|
||||
expect(gather?.automationUnlocked).toBe(true);
|
||||
});
|
||||
|
||||
it('marks actions already in the automation queue', () => {
|
||||
const state = createGameState(content);
|
||||
state.automationQueue = ['gather_supplies'];
|
||||
const view = toView(state, content);
|
||||
const gather = view.actionColumns
|
||||
.flatMap((c) => c.groups)
|
||||
.flatMap((g) => g.actions)
|
||||
.find((a) => a.id === 'gather_supplies');
|
||||
|
||||
expect(gather?.inAutomationQueue).toBe(true);
|
||||
});
|
||||
|
||||
it('projects automation queue ids and display names', () => {
|
||||
const state = createGameState(content);
|
||||
state.automationQueue = ['gather_supplies', 'missing_action'];
|
||||
const view = toView(state, content);
|
||||
|
||||
expect(view.automationQueueIds).toEqual(['gather_supplies', 'missing_action']);
|
||||
expect(view.automationQueueNames).toEqual(['Gather supplies', 'missing_action']);
|
||||
});
|
||||
|
||||
it('shows story actions only when their choice is available, hiding siblings after a fork is taken', () => {
|
||||
const state = createGameState(content);
|
||||
// before reaching the fork, story actions are hidden
|
||||
|
||||
Reference in New Issue
Block a user