fix(selectors): use Maps instead of objects

This commit is contained in:
Dzmitry Shylovich
2016-10-18 01:19:18 +03:00
committed by vsavkin
parent b4265e0685
commit d321b0ebf5
2 changed files with 31 additions and 25 deletions

View File

@ -58,6 +58,12 @@ export function main() {
expect(matched).toEqual([s1[0], 1, s2[0], 2]);
});
it('should not throw for class name "constructor"', () => {
expect(matcher.match(CssSelector.parse('.constructor')[0], selectableCollector))
.toEqual(false);
expect(matched).toEqual([]);
});
it('should select by attr name case sensitive independent of the value', () => {
matcher.addSelectables(s1 = CssSelector.parse('[someAttr]'), 1);
matcher.addSelectables(s2 = CssSelector.parse('[someAttr][someAttr2]'), 2);