Skip to content

Commit

Permalink
add a test for a pseudo without arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed May 12, 2024
1 parent c7f6e47 commit ea057ef
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/__tests__/sourceIndex.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,19 @@ test('pseudo-class', 'h1:first-child', (t, tree) => {
t.deepEqual(tree.nodes[0].nodes[1].sourceIndex, 2);
});

test('pseudo-class without argument', ':not()', (t, tree) => {
t.deepEqual(tree.nodes[0].source.start.column, 1);
t.deepEqual(tree.nodes[0].source.end.column, 6);
t.deepEqual(tree.nodes[0].sourceIndex, 0);
t.deepEqual(tree.nodes[0].nodes[0].source.start.line, 1);
t.deepEqual(tree.nodes[0].nodes[0].source.start.column, 1);
t.deepEqual(tree.nodes[0].nodes[0].source.end.column, 6);
t.deepEqual(tree.nodes[0].nodes[0].sourceIndex, 0);
t.deepEqual(tree.nodes[0].nodes[0].nodes[0].source.start.column, 6);
t.deepEqual(tree.nodes[0].nodes[0].nodes[0].source.end.column, 6);
t.deepEqual(tree.nodes[0].nodes[0].nodes[0].sourceIndex, 5);
});

test('pseudo-class with argument', 'h1:not(.strudel, .food)', (t, tree) => {
t.deepEqual(tree.nodes[0].source.start.column, 1);
t.deepEqual(tree.nodes[0].source.end.column, 23);
Expand Down

0 comments on commit ea057ef

Please sign in to comment.