-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestRunner.js
More file actions
38 lines (35 loc) · 1.27 KB
/
Copy pathTestRunner.js
File metadata and controls
38 lines (35 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* TEST: Verify PDF Folder Structure and Grid Layout
* Run this function from the Apps Script editor to verify v0.9.17 changes.
*/
function TEST_PDF_OUTPUT() {
const testData = {
id: "TEST-INV-999",
clientName: "Antigravity Test Corp",
clientAddress: "123 Starship Drive, Mars Colony 1, 99999",
clientComments: "This is a test of the new monthly folder structure and grid layout.",
salesRep: "Luke (AI Test)",
date: new Date(),
total: 155.50,
items: [
{ sku: "SOL-Pnl-400W", quantity: 2, price: 50.00 },
{ sku: "BATT-LIT-100", quantity: 1, price: 55.50 }
]
};
console.log("Starting PDF Test...");
try {
const pdfUrl = generateOrderPdf(testData);
console.log("Test Success! PDF generated at: " + pdfUrl);
// Show the results to the user if running in a container
try {
const ui = SpreadsheetApp.getUi();
ui.alert("Test Complete", "PDF generated and saved to monthly folder.\nURL: " + pdfUrl, ui.ButtonSet.OK);
} catch (e) {
// Not running in Spreadsheet UI context, just log it
}
return pdfUrl;
} catch (e) {
console.error("Test Failed: " + e.toString());
throw e;
}
}