Skip to content

Commit

Permalink
Add test that would fail with the "last style" behavior in master
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Dec 7, 2017
1 parent b7c5617 commit 913dfce
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/unit/styling-scoped.html
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,30 @@
</script>
</dom-module>

<dom-module id="x-interleaved-styles">
<template>
<style include="x-nested-style"></style>
<style>
:host {
padding-top: 5px;
}
</style>
<style>
:host {
color: blue;
}
</style>
</template>
<script>
addEventListener('WebComponentsReady', () => {
class XInterleaved extends Polymer.Element {
static get is() {return 'x-interleaved-styles';}
}
customElements.define(XInterleaved.is, XInterleaved);
});
</script>
</dom-module>

<script>
(function() {
function assertComputed(element, value, property, pseudo) {
Expand Down Expand Up @@ -955,6 +979,12 @@
assertComputed(e, '10px', 'padding-top');
});

test('interleaved styles and styles with includes work as expected', function() {
var e = document.createElement('x-interleaved-styles');
document.body.appendChild(e);
assertComputed(e, '5px', 'padding-top');
});

});

if (window.ShadyDOM) {
Expand Down

0 comments on commit 913dfce

Please sign in to comment.