Not found page with html and moved utils into index and split http requests to separate files.
Static dir for hosting html files. Helper function for loading HTML. Changed location where openapi.html is generated and updated dockerfile
This commit is contained in:
17
http/index.http
Normal file
17
http/index.http
Normal file
@ -0,0 +1,17 @@
|
||||
### GET index page
|
||||
|
||||
GET {{url}}
|
||||
|
||||
### GET OpenAPI page
|
||||
|
||||
GET {{url}}/openapi
|
||||
|
||||
### GET should fallback to 404 page
|
||||
|
||||
GET {{url}}/something-that-does-not-exist
|
||||
|
||||
> {%
|
||||
client.test("Response status is 404", () => {
|
||||
client.assert(response.status === 404, "Response status is not 404");
|
||||
});
|
||||
%}
|
@ -1,11 +1,3 @@
|
||||
### GET index page
|
||||
|
||||
GET {{url}}
|
||||
|
||||
### GET OpenAPI page
|
||||
|
||||
GET {{url}}/openapi
|
||||
|
||||
### GET Atomic Expression
|
||||
GET {{url}}/simplify/A
|
||||
|
||||
@ -131,33 +123,3 @@ GET {{url}}/simplify/{{expression}}
|
||||
### GET with simplify="true"
|
||||
|
||||
GET {{url}}/simplify/A?simplify=true&hide=NONE&sort=DEFAULT&caseSensitive=false&hideIntermediate=false
|
||||
|
||||
### GET only table
|
||||
|
||||
GET {{url}}/table/A
|
||||
|
||||
> {%
|
||||
client.test("Response body contains only the truth table", () => {
|
||||
client.assert(response.body.truthTable, "Response body does not contain the truth table")
|
||||
});
|
||||
%}
|
||||
|
||||
### GET table and hide intermediate values
|
||||
|
||||
< {%
|
||||
import {expression} from "./common";
|
||||
|
||||
expression("A & B | C")
|
||||
%}
|
||||
GET {{url}}/table/{{expression}}?hideIntermediateSteps=true
|
||||
|
||||
> {%
|
||||
client.test("Response body does not contain intermediate steps", () => {
|
||||
const header = response.body.truthTable.header;
|
||||
const matrix = response.body.truthTable.truthMatrix;
|
||||
client.assert(header.length === 4, "Response body contains intermediate steps")
|
||||
for (let i = 0; i < matrix.length; i++) {
|
||||
client.assert(matrix[i].length === 4, "Response body contains intermediate steps")
|
||||
}
|
||||
});
|
||||
%}
|
||||
|
29
http/table.http
Normal file
29
http/table.http
Normal file
@ -0,0 +1,29 @@
|
||||
### GET only table
|
||||
|
||||
GET {{url}}/table/A
|
||||
|
||||
> {%
|
||||
client.test("Response body contains only the truth table", () => {
|
||||
client.assert(response.body.truthTable, "Response body does not contain the truth table")
|
||||
});
|
||||
%}
|
||||
|
||||
### GET table and hide intermediate values
|
||||
|
||||
< {%
|
||||
import {expression} from "./common";
|
||||
|
||||
expression("A & B | C")
|
||||
%}
|
||||
GET {{url}}/table/{{expression}}?hideIntermediateSteps=true
|
||||
|
||||
> {%
|
||||
client.test("Response body does not contain intermediate steps", () => {
|
||||
const header = response.body.truthTable.header;
|
||||
const matrix = response.body.truthTable.truthMatrix;
|
||||
client.assert(header.length === 4, "Response body contains intermediate steps")
|
||||
for (let i = 0; i < matrix.length; i++) {
|
||||
client.assert(matrix[i].length === 4, "Response body contains intermediate steps")
|
||||
}
|
||||
});
|
||||
%}
|
Reference in New Issue
Block a user