diff --git a/src/app/services/teacherProjectService.spec.ts b/src/app/services/teacherProjectService.spec.ts index 05226c756bd..9d9b5673c83 100644 --- a/src/app/services/teacherProjectService.spec.ts +++ b/src/app/services/teacherProjectService.spec.ts @@ -815,5 +815,11 @@ function removeNodeIdFromTransitions() { expect(service.getNodeById('group3').startId).toEqual(''); }); }); + describe('remove the first lesson', () => { + it('changes the start id of the root group to be the second lesson', () => { + deleteNodeService.deleteNode('group1'); + expect(service.getNodeById('group0').startId).toEqual('group2'); + }); + }); }); } diff --git a/src/assets/wise5/services/teacherProjectService.ts b/src/assets/wise5/services/teacherProjectService.ts index 19526dc2cc4..b3e212bce1b 100644 --- a/src/assets/wise5/services/teacherProjectService.ts +++ b/src/assets/wise5/services/teacherProjectService.ts @@ -1753,7 +1753,7 @@ export class TeacherProjectService extends ProjectService { private updateParentGroupStartId(nodeId: string): void { const parentGroup = this.getParentGroup(nodeId); if (parentGroup != null && parentGroup.startId === nodeId) { - const transitions = this.getTransitionsFromNode(nodeId); + const transitions = this.getTransitionsFromNode(this.getNodeById(nodeId)); if (transitions.length > 0) { for (const transition of transitions) { const toNodeId = transition.to;