Fixed hide intermediate steps, such that header and body is of same length

This commit is contained in:
Martin Berg Alstad
2024-06-17 23:04:47 +02:00
parent bcf8b87f5f
commit 6df5152061
3 changed files with 64 additions and 8 deletions

View File

@ -141,3 +141,23 @@ GET {{url}}/table/A
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")
}
});
%}