feat(save): persist story flags and node progress in v1
This commit is contained in:
@@ -58,6 +58,17 @@ describe('createSave()', () => {
|
||||
state.actionQueue.push('forage');
|
||||
expect(save.state.actionQueue).toEqual(['forage', 'forage']);
|
||||
});
|
||||
|
||||
it('snapshots story fields in the save payload', () => {
|
||||
const state = sampleState();
|
||||
state.storyFlags = { route_a: true };
|
||||
state.currentStoryNodeId = 'route_a_beat';
|
||||
state.seenStoryNodeIds = ['boot_intro', 'route_a_beat'];
|
||||
const save = createSave(state, 1700);
|
||||
expect(save.state.storyFlags).toEqual({ route_a: true });
|
||||
expect(save.state.currentStoryNodeId).toBe('route_a_beat');
|
||||
expect(save.state.seenStoryNodeIds).toHaveLength(2);
|
||||
});
|
||||
});
|
||||
|
||||
describe('serialize / deserialize round-trip', () => {
|
||||
|
||||
Reference in New Issue
Block a user