[Code Style] Run gulp fixstyle
...to apply code style settings from #142.
This commit is contained in:
@@ -76,7 +76,7 @@ define(
|
||||
|
||||
it("provides properties from the original structure", function () {
|
||||
expect(
|
||||
new EditToolbar(testStructure, [ testABC ])
|
||||
new EditToolbar(testStructure, [testABC])
|
||||
.getStructure()
|
||||
.sections[0]
|
||||
.items[1]
|
||||
@@ -87,7 +87,7 @@ define(
|
||||
// This is needed by mct-toolbar
|
||||
it("adds keys to form structure", function () {
|
||||
expect(
|
||||
new EditToolbar(testStructure, [ testABC ])
|
||||
new EditToolbar(testStructure, [testABC])
|
||||
.getStructure()
|
||||
.sections[0]
|
||||
.items[1]
|
||||
@@ -97,20 +97,20 @@ define(
|
||||
|
||||
it("marks empty sections as hidden", function () {
|
||||
// Verify that all sections are included when applicable...
|
||||
toolbar.setSelection([ testABCXYZ ]);
|
||||
toolbar.setSelection([testABCXYZ]);
|
||||
expect(toolbar.getStructure().sections.map(getVisibility))
|
||||
.toEqual([ true, true, false ]);
|
||||
.toEqual([true, true, false]);
|
||||
|
||||
// ...but omitted when only some are applicable
|
||||
toolbar.setSelection([ testABC ]);
|
||||
toolbar.setSelection([testABC]);
|
||||
expect(toolbar.getStructure().sections.map(getVisibility))
|
||||
.toEqual([ true, false, false ]);
|
||||
.toEqual([true, false, false]);
|
||||
});
|
||||
|
||||
it("reads properties from selections", function () {
|
||||
var structure, state;
|
||||
|
||||
toolbar.setSelection([ testABC ]);
|
||||
toolbar.setSelection([testABC]);
|
||||
|
||||
structure = toolbar.getStructure();
|
||||
state = toolbar.getState();
|
||||
@@ -126,9 +126,11 @@ define(
|
||||
it("reads properties from getters", function () {
|
||||
var structure, state;
|
||||
|
||||
testABC.a = function () { return "from a getter!"; };
|
||||
testABC.a = function () {
|
||||
return "from a getter!";
|
||||
};
|
||||
|
||||
toolbar.setSelection([ testABC ]);
|
||||
toolbar.setSelection([testABC]);
|
||||
structure = toolbar.getStructure();
|
||||
state = toolbar.getState();
|
||||
|
||||
@@ -137,7 +139,7 @@ define(
|
||||
});
|
||||
|
||||
it("sets properties on update", function () {
|
||||
toolbar.setSelection([ testABC ]);
|
||||
toolbar.setSelection([testABC]);
|
||||
toolbar.updateState(
|
||||
toolbar.getStructure().sections[0].items[0].key,
|
||||
"new value"
|
||||
@@ -151,7 +153,7 @@ define(
|
||||
|
||||
testABC.a = jasmine.createSpy('a');
|
||||
|
||||
toolbar.setSelection([ testABC ]);
|
||||
toolbar.setSelection([testABC]);
|
||||
structure = toolbar.getStructure();
|
||||
|
||||
toolbar.updateState(
|
||||
@@ -165,7 +167,7 @@ define(
|
||||
it("provides a return value describing update status", function () {
|
||||
// Should return true if actually updated, otherwise false
|
||||
var key;
|
||||
toolbar.setSelection([ testABC ]);
|
||||
toolbar.setSelection([testABC]);
|
||||
key = toolbar.getStructure().sections[0].items[0].key;
|
||||
expect(toolbar.updateState(key, testABC.a)).toBeFalsy();
|
||||
expect(toolbar.updateState(key, "new value")).toBeTruthy();
|
||||
@@ -173,35 +175,35 @@ define(
|
||||
|
||||
it("removes inapplicable items", function () {
|
||||
// First, verify with all items
|
||||
toolbar.setSelection([ testABC ]);
|
||||
toolbar.setSelection([testABC]);
|
||||
expect(toolbar.getStructure().sections[0].items.map(getVisibility))
|
||||
.toEqual([ true, true, true ]);
|
||||
.toEqual([true, true, true]);
|
||||
// Then, try with some items omitted
|
||||
toolbar.setSelection([ testABC, testAB ]);
|
||||
toolbar.setSelection([testABC, testAB]);
|
||||
expect(toolbar.getStructure().sections[0].items.map(getVisibility))
|
||||
.toEqual([ true, true, false ]);
|
||||
.toEqual([true, true, false]);
|
||||
});
|
||||
|
||||
it("removes inconsistent states", function () {
|
||||
// Only two of three values match among these selections
|
||||
toolbar.setSelection([ testABC, testABC2 ]);
|
||||
toolbar.setSelection([testABC, testABC2]);
|
||||
expect(toolbar.getStructure().sections[0].items.map(getVisibility))
|
||||
.toEqual([ false, true, true ]);
|
||||
.toEqual([false, true, true]);
|
||||
});
|
||||
|
||||
it("allows inclusive items", function () {
|
||||
// One inclusive item is in the set, property 'x' of the
|
||||
// second section; make sure items are pruned down
|
||||
// when only some of the selection has x,y,z properties
|
||||
toolbar.setSelection([ testABC, testABCXYZ ]);
|
||||
toolbar.setSelection([testABC, testABCXYZ]);
|
||||
expect(toolbar.getStructure().sections[1].items.map(getVisibility))
|
||||
.toEqual([ true, false, false ]);
|
||||
.toEqual([true, false, false]);
|
||||
});
|
||||
|
||||
it("removes inclusive items when there are no matches", function () {
|
||||
toolbar.setSelection([ testABCYZ ]);
|
||||
toolbar.setSelection([testABCYZ]);
|
||||
expect(toolbar.getStructure().sections[1].items.map(getVisibility))
|
||||
.toEqual([ false, true, true ]);
|
||||
.toEqual([false, true, true]);
|
||||
});
|
||||
|
||||
it("adds click functions when a method is specified", function () {
|
||||
|
||||
Reference in New Issue
Block a user