etapi improvements and more tests

This commit is contained in:
zadam
2022-01-12 19:32:23 +01:00
parent 42e85aefdc
commit 28df5d4aa2
36 changed files with 449 additions and 335 deletions

View File

@@ -1,22 +1,14 @@
GET {{triliumHost}}/etapi/inbox/2022-01-01
Authorization: {{authToken}}
> {%
client.test("Request executed successfully", function() {
client.assert(response.status === 200, "Response status is not 200");
});
%}
> {% client.assert(response.status === 200); %}
###
GET {{triliumHost}}/etapi/calendar/days/2022-01-01
Authorization: {{authToken}}
> {%
client.test("Request executed successfully", function() {
client.assert(response.status === 200, "Response status is not 200");
});
%}
> {% client.assert(response.status === 200); %}
###
@@ -24,10 +16,8 @@ GET {{triliumHost}}/etapi/calendar/days/2022-1
Authorization: {{authToken}}
> {%
client.test("Correct error handling", function() {
client.assert(response.status === 400, "Response status is not 400");
client.assert(response.body.code === "DATE_INVALID");
});
client.assert(response.status === 400);
client.assert(response.body.code === "DATE_INVALID");
%}
###
@@ -35,11 +25,7 @@ Authorization: {{authToken}}
GET {{triliumHost}}/etapi/calendar/weeks/2022-01-01
Authorization: {{authToken}}
> {%
client.test("Request executed successfully", function() {
client.assert(response.status === 200, "Response status is not 200");
});
%}
> {% client.assert(response.status === 200); %}
###
@@ -47,10 +33,8 @@ GET {{triliumHost}}/etapi/calendar/weeks/2022-1
Authorization: {{authToken}}
> {%
client.test("Correct error handling", function() {
client.assert(response.status === 400, "Response status is not 400");
client.assert(response.body.code === "DATE_INVALID");
});
client.assert(response.status === 400);
client.assert(response.body.code === "DATE_INVALID");
%}
###
@@ -58,11 +42,7 @@ Authorization: {{authToken}}
GET {{triliumHost}}/etapi/calendar/months/2022-01
Authorization: {{authToken}}
> {%
client.test("Request executed successfully", function() {
client.assert(response.status === 200, "Response status is not 200");
});
%}
> {% client.assert(response.status === 200); %}
###
@@ -70,10 +50,8 @@ GET {{triliumHost}}/etapi/calendar/months/2022-1
Authorization: {{authToken}}
> {%
client.test("Correct error handling", function() {
client.assert(response.status === 400, "Response status is not 400");
client.assert(response.body.code === "MONTH_INVALID");
});
client.assert(response.status === 400);
client.assert(response.body.code === "MONTH_INVALID");
%}
###
@@ -81,11 +59,7 @@ Authorization: {{authToken}}
GET {{triliumHost}}/etapi/calendar/years/2022
Authorization: {{authToken}}
> {%
client.test("Request executed successfully", function() {
client.assert(response.status === 200, "Response status is not 200");
});
%}
> {% client.assert(response.status === 200); %}
###
@@ -93,11 +67,6 @@ GET {{triliumHost}}/etapi/calendar/years/202
Authorization: {{authToken}}
> {%
client.test("Correct error handling", function() {
client.assert(response.status === 400, "Response status is not 400");
client.assert(response.body.code === "YEAR_INVALID");
});
client.assert(response.status === 400);
client.assert(response.body.code === "YEAR_INVALID");
%}
###