vendorCss.test.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. describe("vendorCss", 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).vendorCss("TransitionDuration",time);
  11. var val=el.style['WebkitTransitionDuration'];
  12. val.should.eql(time);
  13. });
  14. it("should set the vendor neutral css value", function () {
  15. $.feat.cssPrefix ="Webkit";
  16. var el=document.getElementById("moo");
  17. var time="100ms";
  18. $(el).vendorCss("TransitionDuration",time);
  19. var val=el.style['transitionduration'];
  20. val.should.eql(time);
  21. });
  22. it("should not set the another vendor css value", function () {
  23. var el=document.getElementById("moo");
  24. var time="100ms";
  25. $(el).vendorCss("TransitionDuration",time);
  26. var val=el.style['MozTransitionDuration'];
  27. expect(val).to.be.undefined;
  28. });
  29. });