fix(selector): select by attribute independent of value and order

Closes #2513
This commit is contained in:
Tobias Bosch
2015-06-11 11:35:02 -07:00
parent 5bfcca2d5b
commit 9bad70be5e
2 changed files with 23 additions and 0 deletions

View File

@ -68,6 +68,24 @@ export function main() {
expect(matcher.match(CssSelector.parse('[someAttr][someAttr2]')[0], selectableCollector))
.toEqual(true);
expect(matched).toEqual([s1[0], 1, s2[0], 2]);
reset();
expect(matcher.match(CssSelector.parse('[someAttr=someValue][someAttr2]')[0],
selectableCollector))
.toEqual(true);
expect(matched).toEqual([s1[0], 1, s2[0], 2]);
reset();
expect(matcher.match(CssSelector.parse('[someAttr2][someAttr=someValue]')[0],
selectableCollector))
.toEqual(true);
expect(matched).toEqual([s1[0], 1, s2[0], 2]);
reset();
expect(matcher.match(CssSelector.parse('[someAttr2=someValue][someAttr]')[0],
selectableCollector))
.toEqual(true);
expect(matched).toEqual([s1[0], 1, s2[0], 2]);
});
it('should select by attr name only once if the value is from the DOM', () => {