Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

Commit

Permalink
Add .travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Joel committed Oct 28, 2015
1 parent f97d342 commit 2d20d61
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 8 deletions.
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
language: node_js
sudo: false
matrix:
include:
- node_js: stable
script: xvfb-run wct
addons:
firefox: latest
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
- node_js: node
script:
- |
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
wct -s 'default'
fi
before_script:
- npm install web-component-tester
- npm install bower
- export PATH=$PWD/node_modules/.bin:$PATH
- bower install
env:
global:
- secure: ltCkwJM0nkTS9WjikyjqBsB5J2hQon4UnVVrINk4y+Vq4v9PQJH3+83nya0jnxilKaeAJs4d2/OS02F9GkqYpsSmDz7OgXPfk0hrHA8UksvvpSALfnukleIAN2YTOcxXJKeNHcfpqCKPk1dGeNQOEM61H+QgTBIyFB3sMugygqs=
- secure: TJuu1WdpFLTaBN/prBafm8Pld/BQCySNuuG1nATbF3fqiOpgehXu8Z5URAz5syUhqZAyEmuRMxvXpEVD/t1jrtaXVwkdCFkkQ4ckkP4gTIeSGA/Puw8sveB2q7QAqXyTmeFkocNlh8fxV+B07o0SPWdhcvdZnDVU9VrpSqL+92M=
11 changes: 7 additions & 4 deletions test/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,13 @@
s2 = fixture('basic');
});

test('honors the attrForSelected attribute', function() {
assert.equal(s2.attrForSelected, 'id');
assert.equal(s2.selected, 'item2');
assert.equal(s2.selectedItem, document.querySelector('#item2'));
test('honors the attrForSelected attribute', function(done) {
Polymer.Base.async(function() {
assert.equal(s2.attrForSelected, 'id');
assert.equal(s2.selected, 'item2');
assert.equal(s2.selectedItem, document.querySelector('#item2'));
done();
});
});

test('allows assignment to selected', function() {
Expand Down
7 changes: 6 additions & 1 deletion test/excluded-local-names.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,22 @@
});


test('items', function() {
test('items', function(done) {
test1._excludedLocalNames.span = 1;
test2._excludedLocalNames.div = 1;
test1._updateItems();
test2._updateItems();

Polymer.Base.async(function() {
var NOT_FOUND = -1;
var items1 = test1.items.map(function(el) { return el.localName; });
var items2 = test2.items.map(function(el) { return el.localName; });

assert.equal(items1.indexOf('span'), NOT_FOUND);
assert.equal(items2.indexOf('div'), NOT_FOUND);
done();
});
});

});

Expand Down
7 changes: 4 additions & 3 deletions test/multi.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
test('updates selection when dom changes', function(done) {
var selectEventCounter = 0;

s = document.querySelector('#repeatedItems');
s = fixture('test');

Polymer.Base.async(function() {
var firstChild = Polymer.dom(s).querySelector(':first-child');
Expand All @@ -178,11 +178,12 @@

expect(s.selectedItems.length).to.be.equal(2);

t.pop('items');
Polymer.dom(s).removeChild(lastChild);

Polymer.Base.async(function() {
expect(s.selectedItems.length).to.be.equal(1);
}, 1);
done();
});
});

});
Expand Down

0 comments on commit 2d20d61

Please sign in to comment.