Skip to content

Commit

Permalink
Fix test to account for pseudo element differences x-browser.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Jun 29, 2016
1 parent ff88e17 commit 54a462d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 1 addition & 2 deletions test/unit/styling-scoped-elements.html
Expand Up @@ -134,8 +134,7 @@
}

:host(.wide)::after {
content: 'a';
border: 4px solid blue;
content: '-content-';
};

#keyframes2.special {
Expand Down
12 changes: 7 additions & 5 deletions test/unit/styling-scoped.html
Expand Up @@ -61,7 +61,11 @@
function assertComputed(element, value, property, pseudo) {
var computed = getComputedStyle(element, pseudo);
property = property || 'border-top-width';
assert.equal(computed[property], value, 'computed style incorrect for ' + property);
if (Array.isArray(value)) {
assert.oneOf(computed[property], value, 'computed style incorrect for ' + property);
} else {
assert.equal(computed[property], value, 'computed style incorrect for ' + property);
}
}

var styled = document.querySelector('x-styled');
Expand All @@ -73,10 +77,8 @@
test(':host, :host(...)', function() {
assertComputed(styled, '1px');
assertComputed(styledWide, '2px');
assertComputed(styled, '0px', null, '::after');
assertComputed(styledWide, '2px');
assertComputed(styledWide, '4px', null, '::after');

assertComputed(styled, ['', 'none'], 'content', '::after');
assertComputed(styledWide, ['"-content-"', '-content-'], 'content', '::after');
});

test(':host-context(...)', function() {
Expand Down

0 comments on commit 54a462d

Please sign in to comment.