Skip to content
Snippets Groups Projects
Commit 03ccfe5a authored by Axel Prel's avatar Axel Prel
Browse files

wpd error client data test

parent d80e8273
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
import ( import (
"encoding/base64" "encoding/base64"
"encoding/json"
"net/http"
"os"
"testing" "testing"
"time" "time"
...@@ -174,6 +177,25 @@ ...@@ -174,6 +177,25 @@
assert.Contains(t, string(body), "<strong>Client</strong> : client") assert.Contains(t, string(body), "<strong>Client</strong> : client")
} }
}) })
t.Run("wpd error", func(t *testing.T) {
defer tester.SetT(t)()
b, err := os.ReadFile("wpd_error_request.json")
require.NoError(t, err)
var req models.RenderRequest
require.NoError(t, json.Unmarshal(b, &req))
var result []models.Document
tester.Render(
&req, &result
)
require.Equal(t, 1, len(result))
if body, err := base64.StdEncoding.DecodeString(result[0].Body); assert.NoError(t, err) && assert.NotZero(t, len(body)) {
require.NoError(t, os.WriteFile("wpd_error.pdf", body, 0o600))
}
})
} }
const mjmlSource = ` const mjmlSource = `
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment