Skip to content

Commit caafef7

Browse files
committed
Fix custom-style-late tests
The included element was never upgrading because it is an extension element, and CustomStyleInterface boots up async due to webcomponents/shadycss@33512fc and misses the resync. This is solved by making a real element. Also, this test wasn't really "late", so the `<custom-style>` is asynchronous now Fixes #4501
1 parent 7836e6c commit caafef7

2 files changed

Lines changed: 34 additions & 37 deletions

File tree

test/unit/custom-style-late-import.html

Lines changed: 0 additions & 32 deletions
This file was deleted.

test/unit/custom-style-late.html

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,48 @@
1414
<script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
1515
<script src="../../../web-component-tester/browser.js"></script>
1616
<link rel="import" href="../../polymer.html">
17-
<link rel="import" href="custom-style-late-import.html">
18-
1917
</head>
2018
<body>
21-
<input id="input" is="x-input">
19+
20+
<custom-style>
21+
<style is="custom-style">
22+
x-input {
23+
border: 4px solid red;
24+
@apply --cs-blue;
25+
}
26+
</style>
27+
</custom-style>
28+
29+
<template id="late">
30+
<custom-style>
31+
<style is="custom-style">
32+
:root {
33+
--cs-blue: {
34+
border: 8px solid blue;
35+
}
36+
;
37+
}
38+
</style>
39+
</custom-style>
40+
</template>
41+
42+
<x-input id="input"></x-input>
2243

2344
<script>
2445
/* global input */
2546

2647
suite('custom-style late property definition', function() {
2748

28-
test('late defined properties applied to custom-style', function() {
29-
assertComputed(input, '8px');
49+
test('late defined properties applied to custom-style', function(done) {
50+
Polymer({
51+
is: 'x-input'
52+
});
53+
var template = document.querySelector('template#late');
54+
document.body.appendChild(document.importNode(template.content, true));
55+
setTimeout(function() {
56+
assertComputed(input, '8px');
57+
done();
58+
}, 125);
3059
});
3160

3261
});

0 commit comments

Comments
 (0)