Skip to content

Commit

Permalink
Add test case for & selector (#27)
Browse files Browse the repository at this point in the history
Based on w3c/csswg-drafts#10287 we need
to have an explaicit test to see if the specificity for a single
`&` is correct. This commit adds that test.

Closes #26

Co-authored-by: Bart Veneman <[email protected]>
  • Loading branch information
bartveneman and Bart Veneman authored Jun 7, 2024
1 parent 97ccbaf commit 63fa789
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ describe('CALCULATE', () => {
deepEqual(Specificity.calculate(''), []);
});
});

describe('Calculate handles nesting selectors', () => {
it('& = (0,0,0)', () => {
deepEqual(Specificity.calculate('&')[0].toObject(), { a: 0, b: 0, c: 0 });
});
});
});

describe('COMPARE', () => {
Expand Down

0 comments on commit 63fa789

Please sign in to comment.