update components

This commit is contained in:
Luke Pulverenti 2016-06-22 00:39:24 -04:00
parent f64a03b3f4
commit 75a40a8dbb
17 changed files with 177 additions and 88 deletions

View file

@ -1,5 +1,4 @@
<!doctype html>
<!--
<!DOCTYPE html><!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
@ -7,9 +6,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
--><html><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>Tests</title>
@ -18,8 +15,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<body>
<script>
WCT.loadSuites([
'paper-ripple.html'
'paper-ripple.html',
'paper-ripple.html?dom=shadow'
]);
</script>
</body>
</html>
</body></html>

View file

@ -63,6 +63,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template>
</test-fixture>
<test-fixture id="NoRipple">
<template>
<div id="RippleContainer">
</div>
</template>
</test-fixture>
<script>
suite('<paper-ripple>', function () {
var mouseEvent;
@ -130,8 +137,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
});
suite('with the `center` attribute set to true', function () {
setup(function () {
rippleContainer = fixture('CenteringRipple');
@ -191,6 +196,42 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
});
suite('remove a paper ripple', function () {
setup(function () {
rippleContainer = fixture('NoRipple');
});
test('add and remove a paper-ripple', function (done) {
var ripple = document.createElement('paper-ripple');
ripple.addEventListener('transitionend', function() {
expect(ripple.parentNode).to.be.ok;
Polymer.dom(rippleContainer).removeChild(ripple);
done();
});
Polymer.dom(rippleContainer).appendChild(ripple);
ripple.downAction();
ripple.upAction();
});
});
suite('avoid double transitionend event', function () {
setup(function () {
rippleContainer = fixture('NoRipple');
});
test('the transitionend event should only fire once', function (done) {
var ripple = document.createElement('paper-ripple');
var transitionedEventCount = 0;
ripple.addEventListener('transitionend', function() {
++transitionedEventCount;
expect(transitionedEventCount).to.be.eql(1);
Polymer.dom(rippleContainer).removeChild(ripple);
setTimeout(function() { done(); });
});
Polymer.dom(rippleContainer).appendChild(ripple);
ripple.downAction();
ripple.upAction();
});
});
});
</script>