From 95bdc612d5e79f69100e70838601a2b20f96ea66 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 03:48:43 +0000 Subject: [PATCH] test: add test for SurveyEngine.getCurrentNode before start Co-authored-by: alfieprojectsdev <11991855+alfieprojectsdev@users.noreply.github.com> --- field-logic/src/lib/engine.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/field-logic/src/lib/engine.test.ts b/field-logic/src/lib/engine.test.ts index dcf3bb6..10c005d 100644 --- a/field-logic/src/lib/engine.test.ts +++ b/field-logic/src/lib/engine.test.ts @@ -60,6 +60,10 @@ describe('SurveyEngine', () => { engine = new SurveyEngine(mockSurvey, 'test_session'); }); + it('should throw an error if getCurrentNode is called before start', () => { + expect(() => engine.getCurrentNode()).toThrow('Survey not started'); + }); + it('should start at the first node', () => { const node = engine.start(); expect(node.id).toBe('start');