Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

69 строки
2.3 KiB

  1. 'use strict';
  2. var _expect = require('expect.js');
  3. var _expect2 = _interopRequireDefault(_expect);
  4. var _index = require('./index');
  5. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  6. describe('css-vendor', function () {
  7. describe('.prefix', function () {
  8. it('should be correct for .css', function () {
  9. var css = _index.prefix.css;
  10. (0, _expect2['default'])(css).to.be.a('string');
  11. (0, _expect2['default'])(css[0]).to.be('-');
  12. (0, _expect2['default'])(css[css.length - 1]).to.be('-');
  13. (0, _expect2['default'])(css.length >= 3).to.be(true);
  14. });
  15. it('shoud be not empty for .js', function () {
  16. (0, _expect2['default'])(_index.prefix.js).to.be.a('string');
  17. });
  18. });
  19. describe('.supportedProperty()', function () {
  20. it('should not prefix', function () {
  21. (0, _expect2['default'])((0, _index.supportedProperty)('display')).to.be('display');
  22. });
  23. it('should prefix if needed', function () {
  24. var prop = (0, _index.supportedProperty)(_index.prefix.css + 'animation');
  25. if (prop !== 'animation') {
  26. (0, _expect2['default'])(prop).to.be(_index.prefix.css + 'animation');
  27. }
  28. });
  29. it('should return false', function () {
  30. (0, _expect2['default'])((0, _index.supportedProperty)('xxx')).to.be(false);
  31. });
  32. });
  33. describe('.supportedValue()', function () {
  34. it('should not prefix a simple value', function () {
  35. (0, _expect2['default'])((0, _index.supportedValue)('display', 'none')).to.be('none');
  36. });
  37. it('should not prefix a complex value', function () {
  38. var value = 'rgba(255, 255, 255, 1.0)';
  39. (0, _expect2['default'])((0, _index.supportedValue)('color', value)).to.be(value);
  40. });
  41. it('should should prefix if needed', function () {
  42. var value = (0, _index.supportedValue)('display', 'flex');
  43. if (value !== 'flex') {
  44. (0, _expect2['default'])(value).to.be(_index.prefix.css + 'flex');
  45. }
  46. });
  47. it('should return false for unknown value', function () {
  48. (0, _expect2['default'])((0, _index.supportedValue)('display', 'xxx')).to.be(false);
  49. });
  50. it('should return false for "content" value', function () {
  51. (0, _expect2['default'])((0, _index.supportedValue)('content', 'bar')).to.be(false);
  52. });
  53. });
  54. });