Skip to content

Commit da1e89c

Browse files
test(helpers): refactor data.json to data.js
1 parent 29a3230 commit da1e89c

File tree

2 files changed

+30
-21
lines changed

2 files changed

+30
-21
lines changed

test/helpers/data.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* HTML.
3+
*/
4+
module.exports.html = {
5+
single: '<p>foo</p>',
6+
multiple: '<p>foo</p><p>bar</p>',
7+
nested: '<div><p>foo <em>bar</em></p></div>',
8+
attributes:
9+
'<hr id="foo" class="bar baz" style="background: #fff; text-align: center;" data-foo="bar" />',
10+
complex:
11+
'<html><head><meta charSet="utf-8"/><title>Title</title><link rel="stylesheet" href="style.css"/></head><body><header id="header">Header</header><h1 style="color:#000;font-size:42px">Heading</h1><hr/><p>Paragraph</p><img src="image.jpg"/><div class="class1 class2">Some <em>text</em>.</div><script>alert();</script></body></html>',
12+
textarea: '<textarea>foo</textarea>',
13+
script: '<script>alert(1 < 2);</script>',
14+
style: '<style>body > .foo { color: #f00; }</style>',
15+
img: '<img src="http://stat.ic/img.jpg" alt="Image"/>',
16+
void: '<link/><meta/><img/><br/><hr/><input/>',
17+
comment: '<!-- comment -->',
18+
doctype: '<!DOCTYPE html>',
19+
customElement:
20+
'<custom-button class="myClass" custom-attribute="value"></custom-button>'
21+
};
22+
23+
/**
24+
* SVG.
25+
*/
26+
module.exports.svg = {
27+
simple: '<svg viewBox="0 0 512 512" id="foo">Inner</svg>',
28+
complex:
29+
'<svg height="400" width="450"><path id="lineAB" d="M 100 350 l 150 -300" stroke="red" stroke-width="3" fill="none"></path><g stroke="black" stroke-width="3" fill="black"><circle id="pointA" cx="100" cy="350" r="3"></circle></g><g font-size="30" font-family="sans-serif" fill="black" stroke="none" text-anchor="middle"><text x="100" y="350" dx="-30">A</text></g>Your browser does not support inline SVG.</svg>'
30+
};

test/helpers/data.json

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)