not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.3 KiB

  1. define(["sugar-web/graphics/palette"], function (palette) {
  2. 'use strict';
  3. describe("palette", function () {
  4. it("should start down", function () {
  5. var invoker = document.createElement('button');
  6. var myPalette = new palette.Palette(invoker);
  7. expect(myPalette.isDown()).toBe(true);
  8. });
  9. it("should toggle", function () {
  10. var invoker = document.createElement('button');
  11. var myPalette = new palette.Palette(invoker);
  12. myPalette.toggle();
  13. expect(myPalette.isDown()).toBe(false);
  14. myPalette.toggle();
  15. expect(myPalette.isDown()).toBe(true);
  16. });
  17. it("if one palette in a group popups, the others popdown", function () {
  18. var invokerA = document.createElement('button');
  19. var invokerB = document.createElement('button');
  20. var myPaletteA = new palette.Palette(invokerA);
  21. var myPaletteB = new palette.Palette(invokerB);
  22. myPaletteA.toggle();
  23. expect(myPaletteA.isDown()).toBe(false);
  24. expect(myPaletteB.isDown()).toBe(true);
  25. myPaletteB.toggle();
  26. expect(myPaletteA.isDown()).toBe(true);
  27. expect(myPaletteB.isDown()).toBe(false);
  28. });
  29. });
  30. });