Skip to content

Commit

Permalink
Merge pull request #5207 from Polymer/3.x-styling-tests
Browse files Browse the repository at this point in the history
Fixes styling tests related to using HTML Imports
  • Loading branch information
Elliott Marquez authored Apr 27, 2018
2 parents b1a523c + 2674742 commit 48a8483
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 164 deletions.
31 changes: 31 additions & 0 deletions test/unit/custom-style-async-import.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Polymer } from '../../lib/legacy/polymer-fn.js';

const $_documentContainer = document.createElement('div');

$_documentContainer.innerHTML = `<custom-style>
<style is="custom-style">
html {
--cs-blue: {
border : 8px solid blue;
};
}
</style>
</custom-style>
<dom-module id="x-client">
<template>
<style>
:host {
display: inline-block;
border : 4px solid red;
@apply (--cs-blue);
}
</style>
x-client
</template>
</dom-module>`;

document.body.appendChild($_documentContainer);

Polymer({
is: 'x-client'
});
2 changes: 1 addition & 1 deletion test/unit/custom-style-async.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
suite('async global custom-style', function() {

test('async loaded custom-style applies', function(done) {
host.importHref('custom-style-async-import.html', function() {
import('custom-style-async-import.js').then(() => {
afterNextRender(null, function() {
assertComputed(host.$.client, '8px');
done();
Expand Down
119 changes: 0 additions & 119 deletions test/unit/styling-import.html

This file was deleted.

12 changes: 0 additions & 12 deletions test/unit/styling-import1.css

This file was deleted.

13 changes: 0 additions & 13 deletions test/unit/styling-import2.css

This file was deleted.

19 changes: 0 additions & 19 deletions test/unit/styling-scoped.html
Original file line number Diff line number Diff line change
Expand Up @@ -687,19 +687,6 @@
</script>
</dom-module>

<dom-module id="x-only-link-style">
<link rel="import" type="css" href="styling-import-host.css">
<link rel="import" type="css" href="styling-import-host2.css">
<template></template>
<script type="module">
import { PolymerElement } from '../../polymer-element.js';
class XOnlyLink extends PolymerElement {
static get is() { return 'x-only-link-style'; }
}
customElements.define(XOnlyLink.is, XOnlyLink);
</script>
</dom-module>

<dom-module id="double-shared-style">
<template>
<style>
Expand Down Expand Up @@ -1006,12 +993,6 @@
assertComputed(e, '5px', 'padding-top');
});

test('elements without styles work', function() {
var e = document.createElement('x-only-link-style');
document.body.appendChild(e);
assertComputed(e, '2px');
});

});

suite('double including style sheets', function() {
Expand Down

0 comments on commit 48a8483

Please sign in to comment.