Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions field-logic/src/lib/engine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ describe('SurveyEngine', () => {
expect(node.id).toBe('start');
});

it('should throw an error if the survey has no nodes', () => {
const emptySurvey: SurveyDefinition = {
...mockSurvey,
nodes: []
};
const engine = new SurveyEngine(emptySurvey);
expect(() => engine.start()).toThrowError('Survey has no nodes');
});

it('should navigate to next node via default route', () => {
engine.start();
const node = engine.submitAnswer(null); // 'info' type has no answer
Expand Down