test(platform-server): enable meta tag and title service specs for server (#14574)

Fix CSS selector syntax to allow single and double quotes. Needed for meta tag service selector to work properly on parse5.

Fixes #14565.
This commit is contained in:
vikerman
2017-03-01 11:19:22 -08:00
committed by Igor Minar
parent 47bdc2b0b7
commit 9402df92de
5 changed files with 74 additions and 46 deletions

View File

@ -324,6 +324,18 @@ export function main() {
expect(cssSelector.toString()).toEqual('[attrname=attrvalue]');
});
it('should detect attr values with double quotes', () => {
const cssSelector = CssSelector.parse('[attrname="attrvalue"]')[0];
expect(cssSelector.attrs).toEqual(['attrname', 'attrvalue']);
expect(cssSelector.toString()).toEqual('[attrname=attrvalue]');
});
it('should detect attr values with single quotes', () => {
const cssSelector = CssSelector.parse('[attrname=\'attrvalue\']')[0];
expect(cssSelector.attrs).toEqual(['attrname', 'attrvalue']);
expect(cssSelector.toString()).toEqual('[attrname=attrvalue]');
});
it('should detect multiple parts', () => {
const cssSelector = CssSelector.parse('sometag[attrname=attrvalue].someclass')[0];
expect(cssSelector.element).toEqual('sometag');