mirror of
https://github.com/nasa/openmct.git
synced 2024-12-23 15:02:23 +00:00
[Framework] Update spec
Update spec to verify that app.controller et al are not called multiple times with the same key.
This commit is contained in:
parent
d236fd10c3
commit
b163b45a5e
@ -113,6 +113,25 @@ define(
|
||||
// Notably, keys are not needed for run calls
|
||||
});
|
||||
|
||||
it("does not re-register duplicate keys", function () {
|
||||
// Verify preconditions, invoke, expect to have been called
|
||||
expect(mockApp.directive.calls.length).toEqual(0);
|
||||
customRegistrars.directives([{ key: "a" }, { key: "a" }]);
|
||||
expect(mockApp.directive.calls.length).toEqual(1);
|
||||
|
||||
expect(mockApp.controller.calls.length).toEqual(0);
|
||||
customRegistrars.controllers([{ key: "c" }, { key: "c" }, { key: "c" }]);
|
||||
expect(mockApp.controller.calls.length).toEqual(1);
|
||||
|
||||
expect(mockApp.service.calls.length).toEqual(0);
|
||||
customRegistrars.services([{ key: "b" }, { key: "b" }]);
|
||||
expect(mockApp.service.calls.length).toEqual(1);
|
||||
|
||||
// None of this should have warned, this is all
|
||||
// nominal behavior
|
||||
expect(mockLog.warn.calls.length).toEqual(0);
|
||||
});
|
||||
|
||||
it("allows routes to be registered", function () {
|
||||
var mockRouteProvider = jasmine.createSpyObj(
|
||||
"$routeProvider",
|
||||
@ -166,4 +185,4 @@ define(
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user