Skip to content

Commit 6879da0

Browse files
skfdKonstantin Koniev
authored andcommitted
No-Content response test
1 parent bd37724 commit 6879da0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/src/tests/XrmQuery/web/promise/promise.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,20 @@ class Web_Retrieve_Promise extends FakeRequests {
7878
req.respond(200, { 'OData-EntityId': newAccountId }, "");
7979
expect(result).to.eventually.equal(newAccountId);
8080
}
81+
82+
@test
83+
"No-Content response"() {
84+
var result = XrmQuery.retrieveRelated(x => x.accounts, "0000-SOME-GUID", y => y.parentaccountid)
85+
.select(x => [x.createdby_guid])
86+
.promise();
87+
88+
// Check request
89+
expect(this.requests.length).to.equal(1);
90+
var req = this.requests[0];
91+
92+
// Respond and check that body is parsed correctly
93+
req.respond(204, {}, "");
94+
95+
expect(result).to.eventually.deep.equal([]);
96+
}
8197
}

0 commit comments

Comments
 (0)