mirror of
https://github.com/nasa/openmct.git
synced 2024-12-21 22:17:49 +00:00
5aff4e3777
Add baseline specs (not yet matched up to current implementation) for Edit Properties action. WTD-593.
52 lines
1.5 KiB
JavaScript
52 lines
1.5 KiB
JavaScript
/*global define,describe,it,xit,expect,beforeEach*/
|
|
|
|
define(
|
|
["../../src/actions/PropertiesDialog"],
|
|
function (PropertiesDialog) {
|
|
"use strict";
|
|
|
|
describe("Properties dialog", function () {
|
|
|
|
var type, properties, domainObject, model, dialog;
|
|
|
|
beforeEach(function () {
|
|
type = {
|
|
getProperties: function () { return properties; }
|
|
};
|
|
domainObject = {
|
|
getModel: function () { return model; }
|
|
};
|
|
model = { x: "initial value" };
|
|
|
|
dialog = new PropertiesDialog(type, domainObject);
|
|
});
|
|
|
|
it("provides sections based on type properties", function () {
|
|
expect(
|
|
dialog.getSections()[0].rows.length
|
|
).toEqual(properties.length);
|
|
});
|
|
|
|
it("pulls initial values from object model", function () {
|
|
expect(
|
|
dialog.getSections()[0].rows[0].value
|
|
).toEqual("initial value");
|
|
});
|
|
|
|
it("populates models with form results", function () {
|
|
dialog.updateModel(model, {
|
|
a: "new value",
|
|
b: "other new value",
|
|
c: 42
|
|
});
|
|
expect(model).toEqual({
|
|
x: "new value",
|
|
y: "other new value",
|
|
z: 42
|
|
});
|
|
});
|
|
|
|
});
|
|
}
|
|
);
|