better domain isolation
Generate check / check-changes (pull_request) Successful in 2s
Generate check / verify-generate (pull_request) Skipped
Quality / check-changes (pull_request) Successful in 2s
Quality / static-checks (pull_request) Failing after 13s
Quality / run-tests (pull_request) Failing after 54s

This commit is contained in:
natercio committed 2026-10-05 15:08:26 +01:00
1 parent e167627ac3
commit 5c146ad60f
10 files changed
+342 -242

No files matched your search

+7 -11
View File
@@ -6,10 +6,9 @@ import (
"testing"
"time"
htmlwriter "github.com/nmoniz/any2anexoj/internal/writing/html"
"github.com/nmoniz/any2anexoj/internal/writing/table"
"github.com/nmoniz/any2anexoj/internal/writing"
"github.com/nmoniz/any2anexoj/internal"
"github.com/nmoniz/any2anexoj/internal/writing"
htmlwriter "github.com/nmoniz/any2anexoj/internal/writing/html"
"github.com/shopspring/decimal"
)
@@ -64,9 +63,7 @@ func TestWriter_Render(t *testing.T) {
}
var buf bytes.Buffer
// RenderHTML never writes to the printer's output, so Discard is safe.
pp := table.NewPrinter(&buf, loc)
hw := htmlwriter.NewWriter(&buf, pp, loc, "en")
hw := htmlwriter.NewWriter(&buf, loc, "en")
if err := hw.Render(buildTestAggregator(t)); err != nil {
t.Fatalf("Render returned an error: %v", err)
@@ -86,7 +83,8 @@ func TestWriter_Render(t *testing.T) {
`<main class="container-fluid py-4">`,
`<h1>Tax report</h1>`,
`<div class="table-responsive">`,
`<table class="table table-striped table-hover table-bordered">`,
`<table class="table table-striped table-hover table-bordered" style="table-layout: fixed">`,
`<colgroup>`,
`</table>`,
`<tfoot>`,
`</tfoot>`,
@@ -133,8 +131,7 @@ func TestWriter_NoRowDuplication(t *testing.T) {
}
var buf bytes.Buffer
pp := table.NewPrinter(&buf, loc)
hw := htmlwriter.NewWriter(&buf, pp, loc, "en")
hw := htmlwriter.NewWriter(&buf, loc, "en")
aw := buildTestAggregator(t)
@@ -167,8 +164,7 @@ func TestWriter_LangAttribute(t *testing.T) {
}
var buf bytes.Buffer
pp := table.NewPrinter(&buf, loc)
hw := htmlwriter.NewWriter(&buf, pp, loc, "pt")
hw := htmlwriter.NewWriter(&buf, loc, "pt")
if err := hw.Render(buildTestAggregator(t)); err != nil {
t.Fatalf("Render returned an error: %v", err)