simplify_truths/http/table.http
Martin Berg Alstad 2dd361ce7e 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
2024-06-20 14:05:51 +02:00

30 lines
863 B
HTTP

### 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")
}
});
%}