Add some very basic tests

This commit is contained in:
GCHQDeveloper581 2026-06-19 18:16:16 +00:00
parent 5dc7f541bd
commit 2892f4159f
No known key found for this signature in database
GPG Key ID: 6222E059A3DF595C

View File

@ -0,0 +1,37 @@
/**
* RenderPDF tests.
*
* @copyright Crown Copyright 2026
* @license Apache-2.0
*/
import TestRegister from "../../lib/TestRegister.mjs";
TestRegister.addTests([
{
name: "RenderPDF",
input: "Not a PDF",
expectedOutput: "Input does not appear to be a PDF file.",
recipeConfig: [
{
op: "Render PDF",
args: ["Raw"]
},
],
},
{
name: "RenderPDF",
input: "",
expectedMatch: /^<iframe src="data:application\/pdf;base64,JVBERi0xLjAKCjEgMCBvYmogPDwg/,
recipeConfig: [
{
"op": "Generate QR Code",
"args": ["PDF", 1, 1, "Low"]
},
{
"op": "Render PDF",
"args": ["Raw"]
}
],
},
]);