Skip to content

Commit

Permalink
No-Content response test
Browse files Browse the repository at this point in the history
  • Loading branch information
skfd authored and Konstantin Koniev committed Oct 26, 2021
1 parent bd37724 commit 6879da0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/src/tests/XrmQuery/web/promise/promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,20 @@ class Web_Retrieve_Promise extends FakeRequests {
req.respond(200, { 'OData-EntityId': newAccountId }, "");
expect(result).to.eventually.equal(newAccountId);
}

@test
"No-Content response"() {
var result = XrmQuery.retrieveRelated(x => x.accounts, "0000-SOME-GUID", y => y.parentaccountid)
.select(x => [x.createdby_guid])
.promise();

// Check request
expect(this.requests.length).to.equal(1);
var req = this.requests[0];

// Respond and check that body is parsed correctly
req.respond(204, {}, "");

expect(result).to.eventually.deep.equal([]);
}
}

0 comments on commit 6879da0

Please sign in to comment.