Skip to content

Commit

Permalink
add test for 3326
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Jan 27, 2016
1 parent 3d2cb71 commit 854fdbf
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions test/unit/styling-cross-scope-var.html
Original file line number Diff line number Diff line change
Expand Up @@ -474,13 +474,36 @@
</script>
</dom-module>

<style>
.variable-override {
border-top-width: 10px;
}
</style>

<dom-module id="x-variable-override">
<template>
<style>
:host {
--b: 2px solid black;
display: block;
border: var(--b);
}
</style>
</template>
<script>
Polymer({
is: 'x-variable-override'
});
</script>
</dom-module>

<script>
suite('scoped-styling-var', function() {

function assertComputed(element, value, pseudo) {
var name = 'border-top-width';
var computed = element.getComputedStyleValue && !pseudo ?
element.getComputedStyleValue(name) :
var computed = element.getComputedStyleValue && !pseudo ?
element.getComputedStyleValue(name) :
getComputedStyle(element, pseudo)[name];
assert.equal(computed, value, 'computed style incorrect');
}
Expand Down Expand Up @@ -675,6 +698,14 @@
assertComputed(styled.$.endTerm, '19px');
});

// skip for now, until #3326 is fixed
test.skip('custom style class overrides css variable', function() {
var d = document.createElement('x-variable-override');
d.classList.add('variable-override');
document.body.appendChild(d);
assertComputed(d, '10px');
});

// TODO(sorvell): fix for #1761 was reverted; include test once this issue is addressed
// test('var values can be overridden by subsequent concrete properties', function() {
// assertComputed(styled.$.overridesConcrete, '4px');
Expand Down

0 comments on commit 854fdbf

Please sign in to comment.