ignore invalid linear workflow sections that are after the current section

This commit is contained in:
alecmerdler 2017-02-22 16:33:34 -08:00 committed by Joseph Schorr
parent ff07533d80
commit ea9d47ba75
6 changed files with 42 additions and 12 deletions

View file

@ -89,12 +89,21 @@ describe("LinearWorkflowComponent", () => {
new LinearWorkflowSectionComponent(),
];
sections.forEach((section) => {
section.sectionVisible = true;
section.isCurrentSection = true;
section.sectionVisible = false;
section.isCurrentSection = false;
component.addSection(section);
});
});
it("does nothing if invalid section is after the current section", () => {
sections[sections.length - 1].sectionValid = false;
sections[sections.length - 1].sectionId = "Some Section";
component.onSectionInvalid(sections[sections.length - 1].sectionId);
expect(sections[sections.length - 1].isCurrentSection).toBe(false);
expect(sections[sections.length - 1].sectionVisible).toBe(false);
});
it("sets the section with the given id to be the current section", () => {
component.onSectionInvalid(invalidSection.sectionId);
@ -102,6 +111,11 @@ describe("LinearWorkflowComponent", () => {
});
it("hides all sections after the section with the given id", () => {
sections.forEach((section) => {
section.sectionVisible = true;
section.isCurrentSection = true;
component.addSection(section);
});
component.onSectionInvalid(invalidSection.sectionId);
sections.forEach((section) => {