Skip to content

Commit

Permalink
Update test fixtures to latest master. (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
aomarks authored Jan 17, 2018
1 parent fc040b2 commit 0deae2a
Show file tree
Hide file tree
Showing 197 changed files with 1,598 additions and 815 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@
"resolutions": {
"webcomponentsjs": "^1.0.0"
},
"homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior",
"homepage": "https://github.com/polymerelements/iron-a11y-keys-behavior",
"_release": "2.0.1",
"_resolution": {
"type": "version",
"tag": "v2.0.1",
"commit": "a3f03fc3fb5a0d8e93eaa33c2b6c02c16098b402"
},
"_source": "https://github.com/PolymerElements/iron-a11y-keys-behavior.git",
"_source": "https://github.com/polymerelements/iron-a11y-keys-behavior.git",
"_target": "1 - 2",
"_originalSource": "PolymerElements/iron-a11y-keys-behavior"
"_originalSource": "polymerelements/iron-a11y-keys-behavior"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iron-ajax",
"version": "2.0.6",
"version": "2.0.8",
"description": "Makes it easy to make ajax calls and parse the response",
"private": true,
"authors": [
Expand Down Expand Up @@ -53,11 +53,11 @@
"resolutions": {
"webcomponentsjs": "^1.0.0"
},
"_release": "2.0.6",
"_release": "2.0.8",
"_resolution": {
"type": "version",
"tag": "v2.0.6",
"commit": "db9535a8e40795b464679469f5b3dd71b9163def"
"tag": "v2.0.8",
"commit": "fd9fd3b7f6f4dca92358085ee0f9b4f783394410"
},
"_source": "https://github.com/PolymerElements/iron-ajax.git",
"_target": "1 - 2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iron-ajax",
"version": "2.0.6",
"version": "2.0.8",
"description": "Makes it easy to make ajax calls and parse the response",
"private": true,
"authors": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,15 @@
readOnly: true
},

/**
* The `progress` property of this element's `lastRequest`.
*/
lastProgress: {
type: Object,
notify: true,
readOnly: true
},

/**
* True while lastRequest is in flight.
*/
Expand Down Expand Up @@ -348,6 +357,10 @@
'body, sync, handleAs, jsonPrefix, withCredentials, timeout, auto)'
],

created: function() {
this._boundOnProgressChanged = this._onProgressChanged.bind(this);
},

/**
* The query string that should be appended to the `url`, serialized from
* the current value of `params`.
Expand Down Expand Up @@ -422,6 +435,10 @@
return headers;
},

_onProgressChanged: function(event) {
this._setLastProgress(event.detail.value);
},

/**
* Request options suitable for generating an `iron-request` instance based
* on the current state of the `iron-ajax` instance's properties.
Expand Down Expand Up @@ -481,8 +498,16 @@
return request;
}

request.send(requestOptions);
if (this.lastRequest) {
this.lastRequest.removeEventListener('iron-request-progress-changed',
this._boundOnProgressChanged);
}

request.addEventListener('iron-request-progress-changed',
this._boundOnProgressChanged);

request.send(requestOptions);
this._setLastProgress(null);
this._setLastRequest(request);
this._setLoading(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@
loaded: progress.loaded,
total: progress.total
});
}.bind(this));

// Webcomponents v1 spec does not fire *-changed events when not connected
this.fire('iron-request-progress-changed', { value: this.progress });
}.bind(this))

xhr.addEventListener('error', function(error) {
this._setErrored(true);
Expand Down Expand Up @@ -364,6 +367,7 @@
try {
return JSON.parse(xhr.responseText);
} catch (_) {
console.warn('Failed to parse JSON sent from ' + xhr.responseUrl);
return null;
}
}
Expand All @@ -385,6 +389,7 @@
try {
return JSON.parse(xhr.responseText.substring(prefixLen));
} catch (_) {
console.warn('Failed to parse JSON sent from ' + xhr.responseUrl);
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,55 @@
ajax.generateRequest();
});
});

suite('Progress Tests', function() {
var ajax;

setup(function() {
server.restore();
});

test('lastProgress is same as lastRequest', function(done) {
ajax = fixture('TrivialGet');

var lastProgressUpdated = false;

expect(ajax.lastProgress).to.be.eql(undefined);

ajax.generateRequest();

expect(ajax.lastProgress).to.be.eql(null);

var onLastProgressChanged = function() {
expect(ajax.lastProgress.total).to.not.be.undefined;
expect(ajax.lastProgress).to.be.equal(ajax.lastRequest.progress);
lastProgressUpdated = true;
};

ajax.lastRequest.completes.then(function() {
// should have something from last request
expect(ajax.lastProgress).to.be.ok;
ajax.removeEventListener('last-progress-changed',
onLastProgressChanged);
ajax.generateRequest();

// should reset
expect(ajax.lastProgress).to.be.eql(null);

if (lastProgressUpdated) {
done();
} else {
done('lastProgress was never updated');
}
}).catch(function(err) {
done(err);
});

server.respond();

ajax.addEventListener('last-progress-changed', onLastProgressChanged);
});
});
});
</script>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iron-location",
"version": "2.0.2",
"version": "2.0.3",
"description": "Bidirectional data binding into the page's URL.",
"private": true,
"authors": [
Expand Down Expand Up @@ -59,11 +59,11 @@
"resolutions": {
"webcomponentsjs": "^1.0.0"
},
"_release": "2.0.2",
"_release": "2.0.3",
"_resolution": {
"type": "version",
"tag": "v2.0.2",
"commit": "10493907e6ba30b2bd9d21c0f91209d08416b4e8"
"tag": "v2.0.3",
"commit": "1a0c6f979e3ae2f3040daab87c6005dca94d78c5"
},
"_source": "https://github.com/PolymerElements/iron-location.git",
"_target": "1 - 2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ thing! https://github.com/PolymerLabs/tedium/issues
-->

[![Build status](https://travis-ci.org/PolymerElements/iron-location.svg?branch=master)](https://travis-ci.org/PolymerElements/iron-location)
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/PolymerElements/iron-location)

_[Demo and API docs](https://elements.polymer-project.org/elements/iron-location)_

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iron-location",
"version": "2.0.2",
"version": "2.0.3",
"description": "Bidirectional data binding into the page's URL.",
"private": true,
"authors": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@
window.top !== window) {
return null;
}

// If the link is a download, don't intercept.
if (anchor.download) {
return null;
}

var href = anchor.href;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iron-meta",
"version": "2.0.3",
"version": "2.0.4",
"keywords": [
"web-components",
"polymer"
Expand Down Expand Up @@ -46,11 +46,11 @@
"webcomponentsjs": "^1.0.0"
},
"homepage": "https://github.com/PolymerElements/iron-meta",
"_release": "2.0.3",
"_release": "2.0.4",
"_resolution": {
"type": "version",
"tag": "v2.0.3",
"commit": "a7025e67f7cc60de42162e713a0f0589d3c56a20"
"tag": "v2.0.4",
"commit": "88d89fbcb45a8ae87986df686ed3f8659aa11b37"
},
"_source": "https://github.com/PolymerElements/iron-meta.git",
"_target": "1 - 2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iron-meta",
"version": "2.0.3",
"version": "2.0.4",
"keywords": [
"web-components",
"polymer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@

/**
* @constructor
* @param {{type: (string|null), key: (string|null), value: *}} options
* @param {{
* type: (string|null|undefined),
* key: (string|null|undefined),
* value: *,
* }=} options
*/
function IronMeta(options) {
this.type = (options && options.type) || 'default';
this.key = options && options.key;
if ('value' in options) {
if (options && 'value' in options) {
this.value = options.value;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
assert.equal(document.querySelector('iron-meta').list.length, 1);
});

test('constructor with no arguments', function() {
expect(function() {
new Polymer.IronMeta();
}).to.not.throw();
});

});

</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
"test",
"tests"
],
"version": "0.3.9",
"_release": "0.3.9",
"version": "0.3.12",
"_release": "0.3.12",
"_resolution": {
"type": "version",
"tag": "0.3.9",
"commit": "3a4f7a5dae661f0844cb7b07e8667b5666ffc83e"
"tag": "v0.3.12",
"commit": "1dc772bb94815a1e9364c8a143cc303002aefe4f"
},
"_source": "https://github.com/chjj/marked.git",
"_target": "~0.3.9",
Expand Down
Loading

0 comments on commit 0deae2a

Please sign in to comment.