update components

This commit is contained in:
Luke Pulverenti 2016-03-27 19:22:53 -04:00
parent 8c738547c6
commit 52f247c51a
29 changed files with 185 additions and 402 deletions

View file

@ -25,6 +25,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="test-overlay.html">
<link rel="import" href="test-overlay2.html">
<link rel="import" href="test-buttons.html">
<link rel="import" href="test-menu-button.html">
<style is="custom-style">
iron-overlay-backdrop {
@ -113,6 +114,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template>
</test-fixture>
<test-fixture id="composed">
<template>
<test-menu-button>
Composed overlay
<button>Button</button>
</test-menu-button>
</template>
</test-fixture>
<test-buttons id="buttons"></test-buttons>
<input id="focusInput" placeholder="focus input">
@ -925,6 +935,22 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
suite('overlay in composed tree', function() {
test('click on overlay content does not close it', function(done) {
var composed = fixture('composed');
// Opens overlay.
MockInteractions.tap(composed.$.trigger);
composed.$.dropdown.addEventListener('iron-overlay-opened', function() {
// Tap on button inside overlay.
MockInteractions.tap(Polymer.dom(composed).querySelector('button'));
Polymer.Base.async(function(){
assert.isTrue(composed.$.dropdown.opened, 'overlay still opened');
done();
}, 1);
});
});
});
suite('a11y', function() {
test('overlay has aria-hidden=true when opened', function() {

View file

@ -0,0 +1,36 @@
<!--
@license
Copyright (c) 2016 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
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
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="test-overlay.html">
<dom-module id="test-menu-button">
<template>
<button id="trigger" on-click="toggle">Open</button>
<test-overlay id="dropdown">
<content></content>
</test-overlay>
</template>
</dom-module>
<script>
(function() {
Polymer({
is: 'test-menu-button',
toggle: function() {
this.$.dropdown.toggle();
}
});
})();
</script>