Skip to content

Commit

Permalink
No file production in test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsugo authored and wrdhub committed Dec 11, 2024
1 parent 64f69a7 commit a311b7a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
9 changes: 4 additions & 5 deletions test/tests/api/worker/invoicegen/PdfInvoiceGeneratorTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { createTestEntity } from "../../../TestUtils.js"
import { InvoiceDataGetOutTypeRef } from "../../../../../src/common/api/entities/sys/TypeRefs.js"
import { PdfInvoiceGenerator } from "../../../../../src/common/api/worker/invoicegen/PdfInvoiceGenerator.js"
import { object, when } from "testdouble"
import fs from "fs"
import { invoiceItemListMock } from "./invoiceTestUtils.js"
import { PaymentMethod, VatType } from "../../../../../src/common/api/worker/invoicegen/InvoiceUtils.js"

Expand All @@ -28,7 +27,7 @@ o.spec("PdfInvoiceGenerator", function () {

const gen = new PdfInvoiceGenerator(pdfWriter, invoiceData, "1978197819801981931", "NiiNii")
const pdf = await gen.generate()
fs.writeFileSync("/tmp/tuta_jp_invoice_noVat_3.pdf", pdf, { flag: "w" })
//fs.writeFileSync("/tmp/tuta_jp_invoice_noVat_3.pdf", pdf, { flag: "w" })
})

o("pdf generation for russian invoice vatReverseCharge 4_items", async function () {
Expand All @@ -43,7 +42,7 @@ o.spec("PdfInvoiceGenerator", function () {
})
const gen = new PdfInvoiceGenerator(pdfWriter, renderInvoice, "1978197819801981931", "NiiNii")
const pdf = await gen.generate()
fs.writeFileSync("/tmp/tuta_ru_invoice_vatReverse_4.pdf", pdf, { flag: "w" })
//fs.writeFileSync("/tmp/tuta_ru_invoice_vatReverse_4.pdf", pdf, { flag: "w" })
})

o("pdf rendering with 100 entries", async function () {
Expand All @@ -58,7 +57,7 @@ o.spec("PdfInvoiceGenerator", function () {

const gen = new PdfInvoiceGenerator(pdfWriter, invoiceData, "1978197819801981931", "NiiNii")
const pdf = await gen.generate()
fs.writeFileSync("/tmp/tuta_100_entries.pdf", pdf, { flag: "w" })
//fs.writeFileSync("/tmp/tuta_100_entries.pdf", pdf, { flag: "w" })
})

o("pdf rendering with max entries to be put on first page", async function () {
Expand All @@ -69,7 +68,7 @@ o.spec("PdfInvoiceGenerator", function () {
})
const gen = new PdfInvoiceGenerator(pdfWriter, renderInvoice, "1978197819801981931", "NiiNii")
const pdf = await gen.generate()
fs.writeFileSync("/tmp/tuta_max_single_page_test.pdf", pdf, { flag: "w" })
//fs.writeFileSync("/tmp/tuta_max_single_page_test.pdf", pdf, { flag: "w" })
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import o from "@tutao/otest"
import { createTestEntity } from "../../../TestUtils.js"
import { InvoiceDataGetOutTypeRef, InvoiceDataItemTypeRef } from "../../../../../src/common/api/entities/sys/TypeRefs.js"
import { extractCityName, extractPostalCode, XRechnungInvoiceGenerator } from "../../../../../src/common/api/worker/invoicegen/XRechnungInvoiceGenerator.js"
import fs from "fs"

import { InvoiceItemType, InvoiceType, PaymentMethod, VatType } from "../../../../../src/common/api/worker/invoicegen/InvoiceUtils.js"

o.spec("XRechnungInvoiceGenerator", function () {
Expand Down Expand Up @@ -35,7 +35,7 @@ o.spec("XRechnungInvoiceGenerator", function () {
})
const gen = new XRechnungInvoiceGenerator(invoiceData, "1978197819801981931", "MyCustomerId", "[email protected]")
const xml = gen.generate()
fs.writeFileSync("/tmp/xtuta_jp_invoice_noVat_2.xml", xml, { flag: "w" })
//fs.writeFileSync("/tmp/xtuta_jp_invoice_noVat_2.xml", xml, { flag: "w" })
})

o("xrechnung generation for german paypal addVat 3_items", async function () {
Expand Down Expand Up @@ -78,7 +78,7 @@ o.spec("XRechnungInvoiceGenerator", function () {
})
const gen = new XRechnungInvoiceGenerator(invoiceData, "1978197819801981931", "MyCustomerId", "[email protected]")
const xml = gen.generate()
fs.writeFileSync("/tmp/xtuta_de_paypal_addVat_3.xml", xml, { flag: "w" })
//fs.writeFileSync("/tmp/xtuta_de_paypal_addVat_3.xml", xml, { flag: "w" })
})

o("xrechnung generation for german accountBalance vatIncludedHidden 1_items", async function () {
Expand All @@ -105,7 +105,7 @@ o.spec("XRechnungInvoiceGenerator", function () {
})
const gen = new XRechnungInvoiceGenerator(invoiceData, "1978197819801981931", "MyCustomerId", "[email protected]")
const xml = gen.generate()
fs.writeFileSync("/tmp/xtuta_de_accountBalance_includedVat_2.xml", xml, { flag: "w" })
//fs.writeFileSync("/tmp/xtuta_de_accountBalance_includedVat_2.xml", xml, { flag: "w" })
})

o("xrechnung generation for russia noVatReverse creditCard addVat 1_items", async function () {
Expand All @@ -132,7 +132,7 @@ o.spec("XRechnungInvoiceGenerator", function () {
})
const gen = new XRechnungInvoiceGenerator(invoiceData, "1978197819801981931", "MyCustomerId", "[email protected]")
const xml = gen.generate()
fs.writeFileSync("/tmp/xtuta_ru_creditCard_noVatReverseCharge_3.xml", xml, { flag: "w" })
//fs.writeFileSync("/tmp/xtuta_ru_creditCard_noVatReverseCharge_3.xml", xml, { flag: "w" })
})

o("xrechnung generation for credit note", async function () {
Expand Down Expand Up @@ -160,7 +160,7 @@ o.spec("XRechnungInvoiceGenerator", function () {
})
const gen = new XRechnungInvoiceGenerator(invoiceData, "1978197819801981931", "MyCustomerId", "[email protected]")
const xml = gen.generate()
fs.writeFileSync("/tmp/xtuta_credit.xml", xml, { flag: "w" })
//fs.writeFileSync("/tmp/xtuta_credit.xml", xml, { flag: "w" })
})

o("xrechnung generation for discount", async function () {
Expand Down Expand Up @@ -204,7 +204,7 @@ o.spec("XRechnungInvoiceGenerator", function () {
})
const gen = new XRechnungInvoiceGenerator(invoiceData, "1978197819801981931", "MyCustomerId", "[email protected]")
const xml = gen.generate()
fs.writeFileSync("/tmp/xtuta_discount.xml", xml, { flag: "w" })
//fs.writeFileSync("/tmp/xtuta_discount.xml", xml, { flag: "w" })
})

o("xrechnung generation for multi discount", async function () {
Expand Down Expand Up @@ -248,7 +248,7 @@ o.spec("XRechnungInvoiceGenerator", function () {
})
const gen = new XRechnungInvoiceGenerator(invoiceData, "1978197819801981931", "MyCustomerId", "[email protected]")
const xml = gen.generate()
fs.writeFileSync("/tmp/xtuta_multi_discount.xml", xml, { flag: "w" })
//fs.writeFileSync("/tmp/xtuta_multi_discount.xml", xml, { flag: "w" })
})

o("extractPostalCode", function () {
Expand Down

0 comments on commit a311b7a

Please sign in to comment.