-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
865f66c
commit 02d213f
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
define([ | ||
"../../../../../../../../src/js/models/maps/AssetColorPalette" | ||
], function (AssetColorPalette) { | ||
// Configure the Chai assertion library | ||
var should = chai.should(); | ||
var expect = chai.expect; | ||
|
||
describe("AssetColorPalette Test Suite", function () { | ||
/* Set up */ | ||
beforeEach(function () { | ||
this.colorPaletteCategorical = { | ||
"paletteType": "categorical", | ||
"property": "WWA", | ||
"label": "Test Categorical colorPalette", | ||
"colors": [ | ||
{ "value": "Test B", "color": "#e80000" }, | ||
{ "value": "Test A", "color": "#ffab00" }, | ||
] | ||
}; | ||
this.colorPaletteContinuous = { | ||
"paletteType": "continuous", | ||
"property": "WWA", | ||
"label": "Test Continuous colorPalette", | ||
"colors": [ | ||
{ "value": 1, "label": "Test B", "color": "#e80000" }, | ||
{ "value": 0, "label": "Test A", "color": "#ffab00" }, | ||
] | ||
}; | ||
this.opts = {sort: false} | ||
var categoricalColors = this.colorPaletteCategorical.get("colors") | ||
this.categoricalPalette = new AssetColorPalette(categoricalColors, opts) | ||
|
||
var continuousColors = this.colorPaletteContinuous.get("colors") | ||
this.continuousPalette = new AssetColorPalette(continuousColors) | ||
}) | ||
|
||
/* Tear down */ | ||
afterEach(function () { | ||
this.categoricalPalette = undefined; | ||
this.continuousPalette = undefined; | ||
}) | ||
|
||
describe("The categorical AssetColorPalette model", function () { | ||
it("should create an AssetColorPalette model", | ||
function () { | ||
this.categoricalPalette.should.be.instanceof(AssetColorPalette) | ||
}); | ||
}); | ||
|
||
describe("The continuous AssetColorPalette model", function () { | ||
it("should create an AssetColorPalette model", | ||
function () { | ||
this.continuousPalette.should.be.instanceof(AssetColorPalette) | ||
}); | ||
}); | ||
|
||
}); | ||
}); |