customMarkup.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. 'use strict';
  2. let _ = require('lodash');
  3. let utility = require('../utility');
  4. describe('custom markup', function() {
  5. before(function() {
  6. const testHTML = document.querySelectorAll('#custom-markup .hljs');
  7. this.blocks = _.map(testHTML, 'innerHTML');
  8. });
  9. it('should replace tabs', function() {
  10. const filename = utility.buildPath('fixtures', 'expect',
  11. 'tabreplace.txt'),
  12. actual = this.blocks[0];
  13. return utility.expectedFile(filename, 'utf-8', actual);
  14. });
  15. it('should keep custom markup', function() {
  16. const filename = utility.buildPath('fixtures', 'expect',
  17. 'custommarkup.txt'),
  18. actual = this.blocks[1];
  19. return utility.expectedFile(filename, 'utf-8', actual);
  20. });
  21. it('should keep custom markup and replace tabs', function() {
  22. const filename = utility.buildPath('fixtures', 'expect',
  23. 'customtabreplace.txt'),
  24. actual = this.blocks[2];
  25. return utility.expectedFile(filename, 'utf-8', actual);
  26. });
  27. it('should keep the same amount of void elements (<br>, <hr>, ...)', function() {
  28. const filename = utility.buildPath('fixtures', 'expect', 'brInPre.txt'),
  29. actual = this.blocks[3];
  30. return utility.expectedFile(filename, 'utf-8', actual);
  31. });
  32. });