Skip to content

Commit

Permalink
Merge pull request #10 from PolymerElements/update-for-0.9
Browse files Browse the repository at this point in the history
Update for 0.9
  • Loading branch information
cdata committed May 7, 2015
2 parents 958adc3 + 78e075e commit b0d0fb6
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 58 deletions.
23 changes: 13 additions & 10 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"name": "paper-behaviors",
"version": "0.8.0",
"version": "0.9.0",
"authors": [
"The Polymer Authors"
],
"main": [
"paper-button-behavior.html",
"paper-radio-button-behavior.html"
],
"keywords": [
"web-components",
"web-component",
Expand All @@ -16,18 +20,17 @@
},
"license": "MIT",
"homepage": "https://github.com/PolymerElements/paper-behaviors",
"ignore": [
],
"dependencies": {
"polymer": "polymer/polymer#v0.8.0-rc.7",
"iron-behaviors": "PolymerElements/iron-behaviors#^0.8.0"
"polymer": "polymer/polymer#v0.9.0-rc.1",
"iron-behaviors": "PolymerElements/iron-behaviors#^0.9.0"
},
"devDependencies": {
"paper-material": "PolymerElements/paper-material#^0.8.0",
"paper-ripple": "PolymerElements/paper-ripple#^0.8.0",
"iron-test-helpers": "polymerelements/iron-test-helpers#^0.8.0",
"iron-component-page": "polymerelements/iron-component-page#^0.9.0",
"iron-test-helpers": "polymerelements/iron-test-helpers#^0.9.0",
"paper-material": "PolymerElements/paper-material#^0.9.0",
"paper-ripple": "PolymerElements/paper-ripple#^0.9.0",
"test-fixture": "PolymerElements/test-fixture#^0.9.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.0",
"web-component-tester": "Polymer/web-component-tester#^2.2.3",
"test-fixture": "PolymerElements/test-fixture#^0.8.0"
"web-component-tester": "*"
}
}
4 changes: 2 additions & 2 deletions paper-radio-button-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

if (focused) {
var rect = this.$.ink.getBoundingClientRect();
this.$.ink.mousedownAction();
this.$.ink.downAction();
} else {
this.$.ink.mouseupAction();
this.$.ink.upAction();
}
}

Expand Down
92 changes: 46 additions & 46 deletions test/paper-radio-button-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,52 @@
-->

<html>
<head>
<title>paper-radio-button-behavior</title>

<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<script src="../../test-fixture/test-fixture-mocha.js"></script>
<script src="../../iron-test-helpers/mock-interactions.js"></script>

<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="test-radio-button.html">
</head>
<body>

<test-fixture id="basic">
<template>
<test-radio-button></test-radio-button>
</template>
</test-fixture>

<script>
suite('basic', function() {
var button;
var ink;

setup(function() {
button = fixture('basic');
ink = button.querySelector('paper-ripple');
MockInteractions.blur(button);
});

test('normal (no states)', function() {
assert.isFalse(button.focused);
assert.isFalse(ink._animating);
assert.equal(ink.ripples.length, 0);
});

test('receives focus', function() {
MockInteractions.focus(button);

assert.isTrue(button.focused);
assert.isTrue(ink._animating);
assert.equal(ink.ripples.length, 1);
});
<head>
<title>paper-radio-button-behavior</title>

<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<script src="../../test-fixture/test-fixture-mocha.js"></script>
<script src="../../iron-test-helpers/mock-interactions.js"></script>

<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="test-radio-button.html">
</head>
<body>

<test-fixture id="basic">
<template>
<test-radio-button></test-radio-button>
</template>
</test-fixture>

<script>
suite('basic', function() {
var button;
var ink;

setup(function() {
button = fixture('basic');
ink = button.querySelector('paper-ripple');
MockInteractions.blur(button);
});
</script>

</body>
test('normal (no states)', function() {
assert.isFalse(button.focused);
assert.isFalse(ink._animating);
assert.equal(ink.ripples.length, 0);
});

test('receives focus', function() {
MockInteractions.focus(button);

assert.isTrue(button.focused);
assert.isTrue(ink._animating);
assert.equal(ink.ripples.length, 1);
});
});
</script>

</body>
</html>

0 comments on commit b0d0fb6

Please sign in to comment.