Skip to content

Commit

Permalink
Passing test for Error message
Browse files Browse the repository at this point in the history
  • Loading branch information
fundead committed Dec 19, 2016
1 parent bf746b4 commit f94cc90
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Assuming that you don't see any red, you're ready to go. Just be sure to run `gr

## Tests

The unit and E2E tests can be run with `grunt test`. If you add or modify a new feature, please add a new test to `tests/specs`, and a new fixture if required (or reuse an existing one if there's one that fufills your needs).
The unit and E2E tests can be run with `grunt test`. If you add or modify a feature, please add a new test to `tests/specs`, and a new fixture if required (or reuse an existing one if there's one that fufills your needs).

## Submitting pull requests

Expand Down
7 changes: 2 additions & 5 deletions tests/fixtures/common/instrumentXHRs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function() {
window.__requestBodies = [];
window.__requestPayloads = [];
window.__inFlightXHRs = [];
window.__completedXHRs = [];

Expand All @@ -23,10 +23,7 @@
};

XMLHttpRequest.prototype.send = function() {
window.__requestBodies.push({
self: this,
args: arguments
});
window.__requestPayloads.push(JSON.parse(arguments[0]));

origSend.apply(this, arguments);
}
Expand Down
10 changes: 5 additions & 5 deletions tests/specs/v1/payloadTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ describe("Payload functional validation tests for V1", function() {

browser.pause(4000);

var requestBodies = browser.execute(function () {
return window.__requestBodies;
var requestPayloads = browser.execute(function () {
return window.__requestPayloads;
});

var hasRequest = _.any(requestBodies.value, function (req) {
return req.args;
var hasPayload = _.any(requestPayloads.value, function (payload) {
return payload.Details.Error.Message === 'Manual send';
});

expect(hasRequest).toBe(false);
expect(hasPayload).toBe(true);
});

});

0 comments on commit f94cc90

Please sign in to comment.