Skip to content

Commit

Permalink
test: tag with attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait authored and jonathantneal committed Oct 24, 2018
1 parent 63996af commit 4f44148
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/__tests__/tags.js
Expand Up @@ -26,3 +26,13 @@ test('tag with trailing comma', 'h1,', (t, tree) => {
test('tag with trailing slash', 'h1\\', (t, tree) => {
t.deepEqual(tree.nodes[0].nodes[0].value, 'h1\\');
});

test('tag with attribute', 'label[for="email"]', (t, tree) => {
t.deepEqual(tree.nodes[0].nodes[0].value, 'label');
t.deepEqual(tree.nodes[0].nodes[0].type, 'tag');
t.deepEqual(tree.nodes[0].nodes[1].value, 'email');
t.deepEqual(tree.nodes[0].nodes[1].attribute, 'for');
t.deepEqual(tree.nodes[0].nodes[1].operator, '=');
t.deepEqual(tree.nodes[0].nodes[1].type, 'attribute');
t.deepEqual(tree.nodes[0].nodes[1].quoteMark, '"');
});

0 comments on commit 4f44148

Please sign in to comment.