Skip to content

Commit

Permalink
fix(Authoring Tool): Move first lesson no longer breaks step numbering (
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffreykwan authored Jan 30, 2024
1 parent 8b0d13b commit f960e84
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/app/services/teacherProjectService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
});
}
2 changes: 1 addition & 1 deletion src/assets/wise5/services/teacherProjectService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f960e84

Please sign in to comment.