From 1e3d0c484c3fad5fa0f733b6054c5827b14bcc6d Mon Sep 17 00:00:00 2001 From: Nick Woodward Date: Thu, 6 Oct 2016 14:29:25 -0500 Subject: [PATCH] chore: polymer-cli doesn't fail build on failed tests * Add caching * Tests now run for the shadow dom as well as the shady dom --- .editorconfig | 7 +--- .travis.yml | 22 +++++++---- bower.json | 2 +- salte-rating.html | 18 ++++++--- test/basic.html | 93 ++++++++++++++++++++++++++++++++++++++++++++ test/index.html | 98 ++++------------------------------------------- 6 files changed, 131 insertions(+), 109 deletions(-) create mode 100644 test/basic.html diff --git a/.editorconfig b/.editorconfig index 98a761d..c6c8b36 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,12 +1,9 @@ root = true [*] -indent_style = tab +indent_style = space +indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true - -[{package.json,*.yml}] -indent_style = space -indent_size = 2 diff --git a/.travis.yml b/.travis.yml index 3488fbb..7c27c91 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,17 +2,25 @@ language: node_js node_js: stable dist: trusty sudo: required +cache: + directories: + - $(npm config get prefix) + - bower_components addons: - firefox: 46 + firefox: '46.0' sauce_connect: true apt: sources: - - google-chrome + - google-chrome packages: - - google-chrome-stable + - google-chrome-stable before_script: -- npm install -g bower polymer-cli -- bower install + - npm list -g bower --depth=0 || npm install -g bower + - npm list -g polymer-cli --depth=0 || npm install -g polymer-cli + - bower prune + - bower install script: -- xvfb-run polymer test -- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then polymer test -s 'default'; fi + - xvfb-run polymer test + - if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then polymer test -s 'default'; fi +notifications: + email: change diff --git a/bower.json b/bower.json index f1783c1..6786afd 100644 --- a/bower.json +++ b/bower.json @@ -26,7 +26,7 @@ "devDependencies": { "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.2.5", - "web-component-tester": "^4.0.0", + "web-component-tester": "^4.4.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", "paper-slider": "PolymerElements/paper-slider#^1.0.11" } diff --git a/salte-rating.html b/salte-rating.html index 7ebdba2..b5496a7 100644 --- a/salte-rating.html +++ b/salte-rating.html @@ -105,7 +105,15 @@ type: Boolean, value: false, reflectToAttribute: true - } + }, + + /** + * The rating items displayed on the screen + */ + limitItems: { + type: Array, + readOnly: true + } }, attached: function() { @@ -125,15 +133,15 @@ * Renders the items based on the limit */ renderItems: function() { - let limitItems = []; - for (let i = 0; i < this.limit; i++) { + var limitItems = []; + for (var i = 0; i < this.limit; i++) { limitItems.push(i); } - this.set('limitItems', limitItems); + this._setLimitItems(limitItems); }, _refreshRating: function(value) { - let items = this.querySelectorAll('.item-icon'); + var items = Polymer.dom(this.root).querySelectorAll('.item-icon'); for (var i = 0; i < items.length; i++) { items[i].style.width = Math.min(Math.max(value - i, 0), 1) * 100 + '%'; } diff --git a/test/basic.html b/test/basic.html new file mode 100644 index 0000000..cc0dc1b --- /dev/null +++ b/test/basic.html @@ -0,0 +1,93 @@ + + + + + salte-rating basic tests + + + + + + + + + + + + + + + + + + diff --git a/test/index.html b/test/index.html index e5e95d7..40a093b 100644 --- a/test/index.html +++ b/test/index.html @@ -2,101 +2,17 @@ - salte-rating test - - - + + + salte-rating tests - - - - - - - - - - -