Skip to content

Commit

Permalink
US94115 Hybridization (#8) [increment major]?
Browse files Browse the repository at this point in the history
* Hybridization changes

* PR feedback

* Add regular ol' resolution for webcomponentsjs

* US94115 Add Sauce credentials

Also cleaned up .travis.yml a bit to match what we're doing elsewhere.
  • Loading branch information
ChrisKraljevicD2L authored Feb 16, 2018
1 parent 06cb265 commit 1313a7d
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 58 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "brightspace/polymer-config"
}
4 changes: 0 additions & 4 deletions .eslintrc.yml

This file was deleted.

22 changes: 4 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
node_modules
bower_components

# testing
coverage

# production
build

# misc
.DS_Store
.env
npm-debug.log
yarn.lock
public/polymer-components.vulcanized.html
bower_components*
bower-*
node_modules
package-lock.json
19 changes: 7 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
language: node_js
node_js: stable
sudo: false
addons:
firefox: latest
apt:
packages:
- oracle-java8-installer
- oracle-java8-set-default
before_script:
- npm run test:lint:js
- npm run test:lint:wc
node_js: node
script:
- xvfb-run polymer test
- npm run lint
- polymer test --skip-plugin local
env:
global:
- SAUCE_USERNAME: Desire2Learn
- secure: hJJ7bKNTAKw/DksAP7TuZo9FZIcdCidx1CWvzEvJpKwEX6F2NGHOKRwxboZNKO9vRw9XXkxjzSFM/G2TPnyThBlog5B9FvqLNXMu0uItvOGf9kRv3bDFPjbF6tUiKECdDre+4gx/S4wXGAmMJbJ1D4odVpA6pPghd1zPqZ1bR23jOah9VjOFWPjxwMupaIJ8qXD15H3Yagu/a39zK6NE02EvqS6Bd/UXmseR9L9pLzM22m5aTCUrh7WqmeIi4CRFLWRWjH62zpQveE4Nk6zZVfc6Zz4ZQ7MSgXnk0YX+y6d39NGxLNX9v2H2tkk73jY1z12Oqr9b8A1uLWvqMNbmrDxrfgu0I2f/yTENjshjY9fY7mS8kjc5EcMX7EraM0cHWL2NipauNZZLGxcPjyxCJT2DoaNi/r0vdq8K7fu8DFMPu5wQKjmC8OApRblWRa8ui9mp2g11rxpGXETVR+PzcRypPiPYWLeV0nolxgxzTlPergM/BK6jVKK5syTSr9zicYVL8a34dcXEst6AJN9PvtDfr7R1w2PUSDg1QNgfQnIlRLYqaq1QbD/v3Fd7SSEha1PK/ehdPF6UZ4zv6+Vxpmcvq1qOd9RTXc0sWw7MIjVfvvgglVSEW+UWpfOBCDjN5i0iTQHU1b6NTFVVMR4XjzlZmDXmAA/rvMfvMyFLgz0=
17 changes: 15 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,23 @@
"polymer"
],
"dependencies": {
"iron-ajax": "^1.4.3",
"polymer": "^1.8.0"
"iron-ajax": "^2.0.7",
"polymer": "1 - 2"
},
"devDependencies": {
"web-component-tester": "^6.0.0"
},
"variants": {
"1.x": {
"dependencies": {
"polymer": "^1.9.1"
},
"resolutions": {
"webcomponentsjs": "^0.7"
}
}
},
"resolutions": {
"webcomponentsjs": "^1.0.0"
}
}
6 changes: 5 additions & 1 deletion d2l-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@
}
this.$.image.src = URL.createObjectURL(response.detail.response);
} else {
this.fire('d2l-image-failed-to-load', response);
this.dispatchEvent(new CustomEvent('d2l-image-failed-to-load', {
bubbles: true,
composed: true,
detail: { response: response }
}));
}
}
});
Expand Down
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"description": "A Polymer-based web component for images requiring authentication",
"private": true,
"scripts": {
"postinstall": "bower install",
"test": "npm run test:lint:js && npm run test:lint:wc && npm run test:unit",
"test:lint:js": "eslint --ext .js,.html . test/",
"test:lint:wc": "polymer lint -i d2l-image.html",
"test:unit": "polymer test"
"postinstall": "polymer install --variants",
"test": "npm run lint && polymer test --skip-plugin sauce",
"lint": "npm run lint:js && npm run lint:wc",
"lint:js": "eslint *.html",
"lint:wc": "polymer lint -i d2l-image.html"
},
"homepage": "https://github.com/Brightspace/d2l-image#readme",
"repository": {
Expand All @@ -24,10 +24,9 @@
"author": "D2L Corporation",
"license": "Apache-2.0",
"devDependencies": {
"bower": "^1.8.0",
"eslint": "^3.17.0",
"eslint-config-brightspace": "^0.2.1",
"eslint-plugin-html": "^1.7.0",
"polymer-cli": "^1.1.0"
"eslint": "^4.15.0",
"eslint-config-brightspace": "^0.4.0",
"eslint-plugin-html": "^4.0.1",
"polymer-cli": "^1.5.7"
}
}
10 changes: 6 additions & 4 deletions test/d2l-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,21 @@ describe('<d2l-image>', function() {
expect(widget.$.image.src);
});

it('should fire a failed-to-load event if the request was not successful', function() {
it('should fire a failed-to-load event if the request was not successful', function(done) {
var response = {
detail: {
status: 404
}
};

widget = fixture('d2l-image-fixture');
sinon.spy(widget, 'fire');
widget.addEventListener('d2l-image-failed-to-load', function(e) {
expect(!widget.$.image.src);
expect(e.detail.response).to.equal(response);
done();
});

widget._onImageResponse(response);
expect(!widget.$.image.src);
expect(widget.fire).to.have.been.calledWith('d2l-image-failed-to-load', response);
});
});
});
Expand Down
3 changes: 1 addition & 2 deletions test/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
Expand All @@ -8,7 +8,6 @@
</head>
<body>
<script>
'use strict';
WCT.loadSuites([
'./d2l-image.html'
]);
Expand Down
44 changes: 39 additions & 5 deletions wct.config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
{
"plugins":{
"local":{
"browsers":["firefox"]
}
}
"plugins": {
"local": {
"browsers": ["chrome"]
},
"sauce": {
"browsers": [
{
"browserName": "chrome",
"platform": "OS X 10.12",
"version": ""
},
{
"browserName": "chrome",
"platform": "Windows 10",
"version": ""
},
{
"browserName": "firefox",
"platform": "OS X 10.12",
"version": ""
},
{
"browserName": "firefox",
"platform": "Windows 10",
"version": ""
},
{
"browserName": "safari",
"platform": "OS X 10.12",
"version": ""
},
{
"browserName": "microsoftedge",
"platform": "Windows 10",
"version": ""
}
]
}
}
}

0 comments on commit 1313a7d

Please sign in to comment.