cssTranslate.test.js 871 B

123456789101112131415161718192021222324252627282930313233
  1. describe("cssTranslate", function () {
  2. var stubMatrix = { a: 1, b: 1, c: 1, d: 1, e: 1, f: 1 };
  3. beforeEach(function () {
  4. $(document.body).append("<div id=\"moo\"></div>");
  5. });
  6. it("should set the webkit css value", function () {
  7. $.feat.cssPrefix ="Webkit";
  8. var el=document.getElementById("moo");
  9. var time="100ms";
  10. $(el).cssTranslate("100px,0");
  11. var style=el.style["WebkitTransform"];
  12. expect(style==="translate3d(100px, 0px, 0px)").is.true;
  13. });
  14. it("should set the proper x/y coords", function () {
  15. $.feat.cssPrefix ="Webkit";
  16. var el=document.getElementById("moo");
  17. var time="100ms";
  18. $(el).cssTranslate("100px,100px");
  19. var style=el.style["WebkitTransform"];
  20. expect(style==="translate3d(100px, 100px, 0px)").is.true;
  21. });
  22. });