Refactor Manage Trigger to Single Workflow (#2577)
* Refactor Manage Trigger to Single Workflow
This commit is contained in:
parent
d122743129
commit
97256841bd
26 changed files with 1262 additions and 1077 deletions
|
@ -17,23 +17,13 @@ describe("LinearWorkflowComponent", () => {
|
|||
newSection = new LinearWorkflowSectionComponent(component);
|
||||
});
|
||||
|
||||
it("does not set 'sectionVisible' or 'isCurrentSection' of given section if not the first section added", () => {
|
||||
component.addSection(new LinearWorkflowSectionComponent(component));
|
||||
component.addSection(newSection);
|
||||
|
||||
expect(newSection.sectionVisible).toBe(false);
|
||||
expect(newSection.isCurrentSection).toBe(false);
|
||||
});
|
||||
|
||||
it("sets 'sectionVisible' of given section to true if it is the first section added", () => {
|
||||
it("sets 'sectionVisible' and 'isCurrentSection' to first section in list that is not skipped", () => {
|
||||
var skippedSection: LinearWorkflowSectionComponent = new LinearWorkflowSectionComponent(component);
|
||||
skippedSection.skipSection = true;
|
||||
component.addSection(skippedSection);
|
||||
component.addSection(newSection);
|
||||
|
||||
expect(newSection.sectionVisible).toBe(true);
|
||||
});
|
||||
|
||||
it("sets 'isCurrentSection' of given section to true if it is the first section added", () => {
|
||||
component.addSection(newSection);
|
||||
|
||||
expect(newSection.isCurrentSection).toBe(true);
|
||||
});
|
||||
});
|
||||
|
@ -71,6 +61,21 @@ describe("LinearWorkflowComponent", () => {
|
|||
expect(nextSection.isCurrentSection).toBe(true);
|
||||
expect(nextSection.sectionVisible).toBe(true);
|
||||
});
|
||||
|
||||
it("does not set the current section to a skipped section", () => {
|
||||
var skippedSection: LinearWorkflowSectionComponent = new LinearWorkflowSectionComponent(component);
|
||||
var nextSection: LinearWorkflowSectionComponent = new LinearWorkflowSectionComponent(component);
|
||||
skippedSection.skipSection = true;
|
||||
component.addSection(skippedSection);
|
||||
component.addSection(nextSection);
|
||||
component.onNextSection();
|
||||
|
||||
expect(currentSection.isCurrentSection).toBe(false);
|
||||
expect(skippedSection.isCurrentSection).toBe(false);
|
||||
expect(skippedSection.sectionVisible).toBe(false);
|
||||
expect(nextSection.isCurrentSection).toBe(true);
|
||||
expect(nextSection.sectionVisible).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("onSectionInvalid", () => {
|
||||
|
|
Reference in a new issue