aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2018-12-30 08:00:41 +0100
committerache <ache@ache.one>2018-12-30 08:00:41 +0100
commit8919a35f28dde19e400f1a277d54f503c9db365f (patch)
treef5204dac8324d14a11c3723a5677b21ed1d89448
parentUpdate (diff)
Update of md-attr-parser
-rw-r--r--__tests__/index.js42
1 files changed, 31 insertions, 11 deletions
diff --git a/__tests__/index.js b/__tests__/index.js
index 03176a2..ce750fe 100644
--- a/__tests__/index.js
+++ b/__tests__/index.js
@@ -49,52 +49,72 @@ test('line-input-empty-raw', t => {
test('line-input-id', t => {
const {contents} = render('[__Some text__]{#unicorn}');
- t.deepEqual(parse(contents), parse('<p><input id="unicorn" type="text" placeholder="Some text"></p>'));
+ t.deepEqual(parse(contents),
+ parse('<p><input id="unicorn" type="text" placeholder="Some text"></p>')
+ );
});
test('line-input-class', t => {
const {contents} = render('[_______panda__]{.unicorn}');
- t.deepEqual(parse(contents), parse('<p><input class="unicorn" type="text" placeholder="panda"></p>'));
+ t.deepEqual(parse(contents),
+ parse('<p><input class="unicorn" type="text" placeholder="panda"></p>')
+ );
});
test('line-input-classes', t => {
const {contents} = render('[__strong unicorn__]{.unicorn .fox}');
- t.deepEqual(parse(contents), parse('<p><input class="unicorn fox" type="text" placeholder="strong unicorn"></p>'));
+ t.deepEqual(parse(contents),
+ parse('<p><input class="unicorn fox" type="text" placeholder="strong unicorn"></p>')
+ );
});
test('line-input-key-value', t => {
const {contents} = render('[__math exercice__]{unicorn="horse + horn"}');
- t.deepEqual(parse(contents), parse('<p><input unicorn="horse + horn" type="text" placeholder="math exercice"></p>'));
+ t.deepEqual(parse(contents),
+ parse('<p><input unicorn="horse + horn" type="text" placeholder="math exercice"></p>')
+ );
});
test('line-input-overwrite-type', t => {
const {contents} = render('[__Good answer__]{type=buttom}');
- t.deepEqual(parse(contents), parse('<p><input type="text" placeholder="Good answer"></p>'));
+ t.deepEqual(parse(contents),
+ parse('<p><input type="text" placeholder="Good answer"></p>')
+ );
});
test('line-input-overwrite-placeholder', t => {
const {contents} = render('[__Please not a bad answer__]{placeholder=\'not here\'}');
- t.deepEqual(parse(contents), parse('<p><input placeholder="Please not a bad answer" type="text"></p>'));
+ t.deepEqual(parse(contents),
+ parse('<p><input placeholder="Please not a bad answer" type="text"></p>')
+ );
});
test('line-input-overwrite-class', t => {
const {contents} = render('[__A result__]{class=\'unicorn\' .fox}');
- t.deepEqual(parse(contents), parse('<p><input class="fox" type="text" placeholder="A result"></p>'));
+ t.deepEqual(parse(contents),
+ parse('<p><input class="unicorn fox" type="text" placeholder="A result"></p>')
+ );
});
test('line-input-overwrite-id', t => {
const {contents} = render('[__email__]{id=unicorn #fox}');
- t.deepEqual(parse(contents), parse('<p><input id="fox" type="text" placeholder="email"></p>'));
+ t.deepEqual(parse(contents),
+ parse('<p><input id="unicorn" type="text" placeholder="email"></p>')
+ );
});
test('line-input-multi-id', t => {
const {contents} = render('[__Login__]{#unicorn #fox}');
- t.deepEqual(parse(contents), parse('<p><input id="unicorn" type="text" placeholder="Login"></p>'));
+ t.deepEqual(parse(contents),
+ parse('<p><input id="unicorn" type="text" placeholder="Login"></p>')
+ );
});
test('line-input-password', t => {
const {contents} = render('[__Password__]{#passwd type=password}');
- t.deepEqual(parse(contents), parse('<p><input id="passwd" type="password" placeholder="Password"></p>'));
+ t.deepEqual(parse(contents),
+ parse('<p><input id="passwd" type="password" placeholder="Password"></p>')
+ );
});
test('not a line-input', t => {
@@ -126,7 +146,7 @@ test('not a line-input 4', t => {
});
test('is a line-input', t => {
- const {contents} = renderRaw(`a[___This is a text___]qsd`);
+ const {contents} = renderRaw('a[___This is a text___]qsd');
t.not(null, dom5.query(parse5.parse(contents), dom5.predicates.hasTagName('input')));
});