Skip to content

Commit

Permalink
add test to make sure selection palette items dont get removed by ele…
Browse files Browse the repository at this point in the history
…ments already in palette lookup. Issue #142
  • Loading branch information
bgrins committed Feb 25, 2014
1 parent f9148cf commit c1d1b5e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ test( "Local Storage Is Limited ", function() {

var el = $("<input id='spec' value='red' />").spectrum({
localStorageKey: "spectrum.tests",
palette: [["#ff0", "#0ff"]],
maxSelectionSize: 3
});

Expand All @@ -180,6 +181,14 @@ test( "Local Storage Is Limited ", function() {
"Local storage array has been limited"
);

el.spectrum("set", "#ff0");
el.spectrum("set", "#0ff");

equal (
localStorage["spectrum.tests"],
"rgb(204, 0, 0);rgb(187, 0, 0);rgb(170, 0, 0)",
"Local storage array did not get changed by selecting palette items"
);
el.spectrum("destroy");

});
Expand Down

0 comments on commit c1d1b5e

Please sign in to comment.