Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix custom-style-late tests #4503

Merged
merged 2 commits into from
Apr 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions test/unit/custom-style-late-import.html

This file was deleted.

41 changes: 36 additions & 5 deletions test/unit/custom-style-late.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,50 @@
<script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../../web-component-tester/browser.js"></script>
<link rel="import" href="../../polymer.html">
<link rel="import" href="custom-style-late-import.html">

</head>
<body>
<input id="input" is="x-input">

<custom-style>
<style is="custom-style">
x-input {
border: 4px solid red;
@apply --cs-blue;
}
</style>
</custom-style>

<template id="late">
<custom-style>
<style is="custom-style">
html {
--cs-blue: {
border: 8px solid blue;
};
}
</style>
</custom-style>
</template>

<x-input id="input"></x-input>

<script>
/* global input */

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

test('late defined properties applied to custom-style', function() {
assertComputed(input, '8px');
test('late defined properties applied to custom-style', function(done) {
Polymer({
is: 'x-input'
});
var template = document.querySelector('template#late');
document.body.appendChild(document.importNode(template.content, true));
// wait 2 rounds of `afterNextRender` as `<custom-style>` boots asynchronously
Polymer.RenderStatus.afterNextRender(null, function() {
Polymer.RenderStatus.afterNextRender(null, function() {
assertComputed(input, '8px');
done();
});
});
});

});
Expand Down