UI test cases
diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js
index 6e33e1d..06a3e28 100644
--- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js
@@ -19,7 +19,8 @@
{contact_person: 'Contact 3-Test Supplier'},
{taxes_and_charges: 'TEST In State GST'},
{tc_name: 'Test Term 1'},
- {terms: 'This is Test'}
+ {terms: 'This is Test'},
+ {payment_terms_template: '_Test Payment Term Template UI'}
]);
},
() => cur_frm.save(),
@@ -33,6 +34,9 @@
// grand_total Calculated
assert.ok(cur_frm.doc.grand_total==590, "Grad Total correct");
+ assert.ok(cur_frm.doc.payment_terms_template, "Payment Terms Template is correct");
+ assert.ok(cur_frm.doc.payment_schedule.length > 0, "Payment Term Schedule is not empty");
+
},
() => frappe.tests.click_button('Submit'),
() => frappe.tests.click_button('Yes'),
diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.js
index f7a4488..b4be3ba 100644
--- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.js
@@ -1,7 +1,7 @@
QUnit.module('Sales Invoice');
QUnit.test("test sales Invoice", function(assert) {
- assert.expect(4);
+ assert.expect(6);
let done = assert.async();
frappe.run_serially([
() => {
@@ -19,7 +19,8 @@
{contact_person: 'Contact 1-Test Customer 1'},
{taxes_and_charges: 'TEST In State GST'},
{tc_name: 'Test Term 1'},
- {terms: 'This is Test'}
+ {terms: 'This is Test'},
+ {payment_terms_template: '_Test Payment Term Template UI'}
]);
},
() => cur_frm.save(),
@@ -31,7 +32,10 @@
// get tax account head details
assert.ok(cur_frm.doc.taxes[0].account_head=='CGST - '+frappe.get_abbr(frappe.defaults.get_default('Company')), " Account Head abbr correct");
// grand_total Calculated
- assert.ok(cur_frm.doc.grand_total==590, "Grad Total correct");
+ assert.ok(cur_frm.doc.grand_total==590, "Grand Total correct");
+
+ assert.ok(cur_frm.doc.payment_terms_template, "Payment Terms Template is correct");
+ assert.ok(cur_frm.doc.payment_schedule.length > 0, "Payment Term Schedule is not empty");
},
() => frappe.tests.click_button('Submit'),
diff --git a/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js b/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js
index 736443e..14c0d55 100644
--- a/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js
+++ b/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js
@@ -19,7 +19,8 @@
{contact_person: 'Contact 1-Test Customer 1'},
{taxes_and_charges: 'TEST In State GST'},
{tc_name: 'Test Term 1'},
- {terms: 'This is Test'}
+ {terms: 'This is Test'},
+ {payment_terms_template: '_Test Payment Term Template UI'}
]);
},
() => cur_frm.save(),
@@ -43,6 +44,7 @@
() => { cur_frm.set_value('paid_to','Cash - '+frappe.get_abbr(frappe.defaults.get_default('Company')));},
() => {cur_frm.set_value('reference_no','TEST1234');},
() => {cur_frm.set_value('reference_date',frappe.datetime.add_days(frappe.datetime.nowdate(), 0));},
+ () => cur_frm.set_value("payment_schedule", []),
() => cur_frm.save(),
() => {
// get payment details
diff --git a/erpnext/selling/doctype/quotation/tests/test_quotation.js b/erpnext/selling/doctype/quotation/tests/test_quotation.js
index 37491ed..d69d799 100644
--- a/erpnext/selling/doctype/quotation/tests/test_quotation.js
+++ b/erpnext/selling/doctype/quotation/tests/test_quotation.js
@@ -1,5 +1,5 @@
QUnit.test("test: quotation", function (assert) {
- assert.expect(10);
+ assert.expect(12);
let done = assert.async();
frappe.run_serially([
() => {
@@ -49,6 +49,9 @@
// Check Terms and Condtions
assert.ok(cur_frm.doc.tc_name == "Test Term 1", "Terms and Conditions Checked");
+ assert.ok(cur_frm.doc.payment_terms_template, "Payment Terms Template is correct");
+ assert.ok(cur_frm.doc.payment_schedule.length > 0, "Payment Term Schedule is not empty");
+
},
() => done()
]);
diff --git a/erpnext/selling/doctype/sales_order/tests/test_sales_order.js b/erpnext/selling/doctype/sales_order/tests/test_sales_order.js
index 12661e3..8e813db 100644
--- a/erpnext/selling/doctype/sales_order/tests/test_sales_order.js
+++ b/erpnext/selling/doctype/sales_order/tests/test_sales_order.js
@@ -1,7 +1,7 @@
QUnit.module('Sales Order');
QUnit.test("test sales order", function(assert) {
- assert.expect(10);
+ assert.expect(12);
let done = assert.async();
frappe.run_serially([
() => {
@@ -50,6 +50,9 @@
() => cur_frm.print_doc(),
() => frappe.timeout(1),
() => {
+ assert.ok(cur_frm.doc.payment_terms_template, "Payment Terms Template is correct");
+ assert.ok(cur_frm.doc.payment_schedule.length > 0, "Payment Term Schedule is not empty");
+
assert.ok($('.btn-print-print').is(':visible'), "Print Format Available");
frappe.timeout(1);
assert.ok($(".section-break+ .section-break .column-break:nth-child(1) .data-field:nth-child(1) .value").text().includes("Billing Street 1"), "Print Preview Works As Expected");