Skip to content

Commit e8f5918

Browse files
German e2e test
1 parent ab49406 commit e8f5918

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

tests/fixtures.bash

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ cx33_invoice() {
4040
CSV
4141
}
4242

43+
cx33_invoice_de() {
44+
write_invoice "$1" <<CSV
45+
"P","CX33 Cloud Server",,,"1,0000",01.11.2025,30.11.2025,,"Monate","b1",,"4,9900 €"
46+
CSV
47+
}
48+
4349
rounding_assets() {
4450
stage_assets "$1"
4551
write_prices "$1" <<CSV

tests/unit.bats

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,16 @@ HTML
137137
[ "$(sqlite3 "$db" "SELECT printf('%.2f|%.2f', paid, optimal) FROM priced;")" = "4.99|3.79" ]
138138
}
139139

140+
@test "build_db audits a German-locale invoice identically to English (end-to-end)" {
141+
a="$BATS_TEST_TMPDIR/dea"; fixture_assets "$a"
142+
d="$BATS_TEST_TMPDIR/ded"; mkdir -p "$d"; cx33_invoice_de "$d/i.csv"
143+
db="$BATS_TEST_TMPDIR/de2.db"
144+
run build_db "$db" "$a" "$d"
145+
[ "$status" -eq 0 ]
146+
[ "$(sqlite3 "$db" 'SELECT price_group FROM detected_group;')" = "eu" ]
147+
[ "$(sqlite3 "$db" "SELECT printf('%s|%s|%.2f|%.2f', month, kind, paid, optimal) FROM priced;")" = "2025-11|monthly|4.99|3.79" ]
148+
}
149+
140150
@test "build_db fails when a price asset is missing" {
141151
a="$BATS_TEST_TMPDIR/assets3"; fixture_assets "$a"; rm "$a/providers/hetzner/prices.csv"
142152
d="$BATS_TEST_TMPDIR/inv3"; mkdir -p "$d"; cx33_invoice "$d/i.csv"

0 commit comments

Comments
 (0)