make sure ._ osx files are properly ignored

This commit is contained in:
Luke Pulverenti 2015-11-04 18:49:06 -05:00
parent cb8119840a
commit 67524136ed
48 changed files with 1239 additions and 387 deletions

View file

@ -33,6 +33,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template>
</test-fixture>
<test-fixture id="ButtonWithInput">
<template>
<test-light-dom><input id="input"></test-light-dom>
</template>
</test-fixture>
<script>
suite('active-state', function() {
var activeTarget;
@ -192,6 +198,39 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
MockInteractions.pressEnter(activeTarget);
});
});
suite('nested input inside button', function() {
test('space in light child input does not trigger a button click event', function(done) {
var item = fixture('ButtonWithInput');
var input = item.querySelector('#input');
var itemClickHandler = sinon.spy();
item.addEventListener('click', itemClickHandler);
input.focus();
MockInteractions.pressSpace(input);
setTimeout(function(){
expect(itemClickHandler.callCount).to.be.equal(0);
done();
}, 100);
});
test('space in button triggers a button click event', function(done) {
var item = fixture('ButtonWithInput');
var input = item.querySelector('#input');
var itemClickHandler = sinon.spy();
item.addEventListener('click', itemClickHandler);
MockInteractions.pressSpace(item);
setTimeout(function(){
expect(itemClickHandler.callCount).to.be.equal(1);
done();
}, 100);
});
});
});
</script>
</body>

View file

@ -34,6 +34,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template>
</test-fixture>
<test-fixture id="LightDOM">
<template>
<test-light-dom>
<input id="input">
</test-light-dom>
</template>
</test-fixture>
<script>
suite('focused-state', function() {
var focusTarget;
@ -112,6 +120,29 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
suite('elements in the light dom', function() {
var lightDOM, input;
setup(function() {
lightDOM = fixture('LightDOM');
input = document.querySelector('#input');
});
test('should not fire the focus event', function() {
var nFocusEvents = 0;
lightDOM.addEventListener('focus', function() {
nFocusEvents += 1;
});
MockInteractions.focus(input);
expect(nFocusEvents).to.be.equal(0);
});
});
</script>
</body>

View file

@ -64,3 +64,26 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
</script>
<dom-module id="test-light-dom">
<template>
<content select="*"></content>
</template>
</dom-module>
<script>
Polymer({
is: 'test-light-dom',
behaviors: [
Polymer.IronControlState,
Polymer.IronButtonState
]
});
</script>