buildClassName.js 988 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. 'use strict';
  2. let _ = require('lodash');
  3. describe('block class names', function() {
  4. before(function() {
  5. const testHTML = document.querySelectorAll('#build-classname .hljs');
  6. this.blocks = _.map(testHTML, 'className');
  7. });
  8. it('should add language class name to block', function() {
  9. const expected = 'some-class hljs xml',
  10. actual = this.blocks[0];
  11. actual.should.equal(expected);
  12. });
  13. it('should not clutter block class (first)', function () {
  14. const expected = 'hljs some-class xml',
  15. actual = this.blocks[1];
  16. actual.should.equal(expected);
  17. });
  18. it('should not clutter block class (last)', function () {
  19. const expected = 'some-class hljs xml',
  20. actual = this.blocks[2];
  21. actual.should.equal(expected);
  22. });
  23. it('should not clutter block class (spaces around)', function () {
  24. const expected = 'hljs some-class xml',
  25. actual = this.blocks[3];
  26. actual.should.equal(expected);
  27. });
  28. });