refactoring linear workflow directives
This commit is contained in:
parent
a83a7fe47a
commit
e59d394491
10 changed files with 240 additions and 22 deletions
|
@ -0,0 +1,25 @@
|
|||
import { LinearWorkflowSectionComponent } from './linear-workflow-section.component';
|
||||
import { LinearWorkflowComponent } from './linear-workflow.component';
|
||||
import Spy = jasmine.Spy;
|
||||
|
||||
|
||||
describe("LinearWorkflowSectionComponent", () => {
|
||||
var component: LinearWorkflowSectionComponent;
|
||||
var parentMock: LinearWorkflowComponent;
|
||||
|
||||
beforeEach(() => {
|
||||
component = new LinearWorkflowSectionComponent();
|
||||
parentMock = new LinearWorkflowComponent();
|
||||
component.parent = parentMock;
|
||||
});
|
||||
|
||||
describe("$onInit", () => {
|
||||
|
||||
it("calls parent component to add itself as a section", () => {
|
||||
var addSectionSpy: Spy = spyOn(parentMock, "addSection").and.returnValue(null);
|
||||
component.$onInit();
|
||||
|
||||
expect(addSectionSpy.calls.argsFor(0)[0]).toBe(component);
|
||||
});
|
||||
});
|
||||
});
|
Reference in a new issue