[Forms] Prune obsolete specs
Prune obsolete specs after changes made to support integration of forms component, WTD-593.
This commit is contained in:
@@ -25,7 +25,10 @@ define(
|
||||
}
|
||||
|
||||
beforeEach(function () {
|
||||
mockScope = jasmine.createSpyObj("$scope", [ "$on" ]);
|
||||
mockScope = jasmine.createSpyObj(
|
||||
"$scope",
|
||||
[ "$on", "$watch" ]
|
||||
);
|
||||
mockObjectService = jasmine.createSpyObj(
|
||||
"objectService",
|
||||
[ "getObjects" ]
|
||||
@@ -60,20 +63,6 @@ define(
|
||||
);
|
||||
});
|
||||
|
||||
it("provides a means of changing navigation", function () {
|
||||
// Browse template needs a setNavigation function
|
||||
|
||||
// Verify precondition
|
||||
expect(mockNavigationService.setNavigation)
|
||||
.not.toHaveBeenCalled();
|
||||
|
||||
// Set navigation via controller
|
||||
controller.setNavigation(mockDomainObject);
|
||||
|
||||
expect(mockNavigationService.setNavigation)
|
||||
.toHaveBeenCalledWith(mockDomainObject);
|
||||
});
|
||||
|
||||
it("uses composition to set the navigated object, if there is none", function () {
|
||||
mockRootObject.useCapability.andReturn(mockPromise([
|
||||
mockDomainObject
|
||||
|
||||
@@ -19,10 +19,7 @@ define(
|
||||
"property" + name,
|
||||
[ "getDefinition", "getValue", "setValue" ]
|
||||
);
|
||||
mockProperty.getDefinition.andReturn({
|
||||
name: name,
|
||||
key: name.toLowerCase()
|
||||
});
|
||||
mockProperty.getDefinition.andReturn({});
|
||||
return mockProperty;
|
||||
}
|
||||
|
||||
@@ -62,23 +59,23 @@ define(
|
||||
});
|
||||
|
||||
it("creates a form model with a Properties section", function () {
|
||||
expect(wizard.getFormModel().sections[0].name)
|
||||
expect(wizard.getFormStructure().sections[0].name)
|
||||
.toEqual("Properties");
|
||||
});
|
||||
|
||||
it("adds one row per defined type property", function () {
|
||||
// Three properties were defined in the mock type
|
||||
expect(wizard.getFormModel().sections[0].rows.length)
|
||||
expect(wizard.getFormStructure().sections[0].rows.length)
|
||||
.toEqual(3);
|
||||
});
|
||||
|
||||
it("interprets form data using type-defined properties", function () {
|
||||
// Use key names from mock properties
|
||||
wizard.createModel({
|
||||
a: "field 0",
|
||||
b: "field 1",
|
||||
c: "field 2"
|
||||
});
|
||||
wizard.createModel([
|
||||
"field 0",
|
||||
"field 1",
|
||||
"field 2"
|
||||
]);
|
||||
|
||||
// Should have gotten a setValue call
|
||||
mockProperties.forEach(function (mockProperty, i) {
|
||||
|
||||
Reference in New Issue
Block a user