Index: lib/src/paper-behaviors/test/paper-ripple-behavior.html |
diff --git a/lib/src/paper-behaviors/test/paper-button-behavior.html b/lib/src/paper-behaviors/test/paper-ripple-behavior.html |
similarity index 50% |
copy from lib/src/paper-behaviors/test/paper-button-behavior.html |
copy to lib/src/paper-behaviors/test/paper-ripple-behavior.html |
index 9663938d72d62a8e0c5052f746bb19bd2c498157..dcccc44ab58c7b1fee85ee8a79af234d95b385c7 100644 |
--- a/lib/src/paper-behaviors/test/paper-button-behavior.html |
+++ b/lib/src/paper-behaviors/test/paper-ripple-behavior.html |
@@ -11,7 +11,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
<html> |
<head> |
- <title>paper-button-behavior</title> |
+ <title>paper-ripple-behavior</title> |
<script src="../../webcomponentsjs/webcomponents-lite.js"></script> |
<script src="../../web-component-tester/browser.js"></script> |
@@ -20,61 +20,61 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
<link rel="import" href="../../polymer/polymer.html"> |
<link rel="import" href="../../test-fixture/test-fixture.html"> |
- <link rel="import" href="test-button.html"> |
+ <link rel="import" href="../../iron-behaviors/iron-button-state.html"> |
+ <link rel="import" href="../paper-ripple-behavior.html"> |
</head> |
<body> |
+ <dom-module id="test-ripple"> |
+ <template> |
+ </template> |
+ <script> |
+ HTMLImports.whenReady(function() { |
+ Polymer({ |
+ is: 'test-ripple', |
+ behaviors: [ |
+ Polymer.IronButtonState, |
+ Polymer.IronControlState, |
+ Polymer.PaperRippleBehavior |
+ ] |
+ }); |
+ }); |
+ </script> |
+ </dom-module> |
+ |
<test-fixture id="basic"> |
<template> |
- <test-button></test-button> |
+ <test-ripple></test-ripple> |
</template> |
</test-fixture> |
<script> |
- suite('basic', function() { |
- var button; |
+ suite('PaperRippleBehavior', function() { |
+ var ripple; |
setup(function() { |
- button = fixture('basic'); |
+ ripple = fixture('basic'); |
}); |
- test('normal (no states)', function() { |
- assert.equal(button._elevation, 1); |
+ test('no ripple at startup', function() { |
+ assert.isFalse(ripple.hasRipple()); |
}); |
- test('set disabled property', function() { |
- button.disabled = true; |
- assert.equal(button._elevation, 0); |
+ test('calling getRipple returns ripple', function() { |
+ assert.ok(ripple.getRipple()); |
}); |
- test('pressed and released', function() { |
- MockInteractions.down(button); |
- assert.equal(button._elevation, 4); |
- MockInteractions.up(button); |
- assert.equal(button._elevation, 1); |
+ test('focus generates ripple', function() { |
+ MockInteractions.focus(ripple); |
+ assert.ok(ripple.hasRipple()); |
}); |
- suite('a button with toggles', function() { |
- setup(function() { |
- button.toggles = true; |
- }); |
- |
- test('activated by tap', function(done) { |
- MockInteractions.downAndUp(button, function() { |
- try { |
- assert.equal(button._elevation, 4); |
- done(); |
- } catch (e) { |
- done(e); |
- } |
- }); |
- }); |
+ test('down generates ripple', function() { |
+ MockInteractions.down(ripple); |
+ assert.ok(ripple.hasRipple()); |
+ MockInteractions.up(ripple); |
}); |
- test('receives focused', function() { |
- MockInteractions.focus(button); |
- assert.equal(button._elevation, 3); |
- }); |
}); |
</script> |