fix ui tests

This commit is contained in:
tunde 2017-09-25 17:41:22 +01:00
parent cd9bc6f795
commit 541d3f9567
6 changed files with 37 additions and 9 deletions

View File

@ -10,7 +10,8 @@ QUnit.test("test: quotation", function (assert) {
{"item_code": "Test Product 1"},
{"qty": 5}
]]
}
},
{payment_terms_template: '_Test Payment Term Template UI'}
]);
},
() => {
@ -18,7 +19,7 @@ QUnit.test("test: quotation", function (assert) {
assert.ok(cur_frm.doc.items[0].item_name == "Test Product 1", "Added Test Product 1");
// calculate_taxes_and_totals
assert.ok(cur_frm.doc.grand_total === 500, "Total Amount is correct");
assert.ok(cur_frm.doc.grand_total === 500, String(cur_frm.doc.grand_total));
},
() => cur_frm.set_value("customer_address", "Test1-Billing"),
() => cur_frm.set_value("shipping_address_name", "Test1-Warehouse"),
@ -30,6 +31,7 @@ QUnit.test("test: quotation", function (assert) {
() => cur_frm.doc.items[0].rate = 200,
() => frappe.timeout(0.3),
() => cur_frm.set_value("tc_name", "Test Term 1"),
() => cur_frm.set_value("payment_schedule", []),
() => frappe.timeout(0.5),
() => cur_frm.save(),
() => {

View File

@ -16,13 +16,15 @@ QUnit.test("test quotation with additional discount in grand total", function(as
]},
{customer_address: 'Test1-Billing'},
{shipping_address_name: 'Test1-Shipping'},
{contact_person: 'Contact 1-Test Customer 1'}
{contact_person: 'Contact 1-Test Customer 1'},
{payment_terms_template: '_Test Payment Term Template UI'}
]);
},
() => {
return frappe.tests.set_form_values(cur_frm, [
{apply_discount_on:'Grand Total'},
{additional_discount_percentage:10}
{additional_discount_percentage:10},
{payment_schedule: []}
]);
},
() => cur_frm.save(),

View File

@ -19,13 +19,15 @@ QUnit.test("test sales order", function(assert) {
{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'}
]);
},
() => {
return frappe.tests.set_form_values(cur_frm, [
{selling_price_list:'Test-Selling-USD'},
{currency: 'USD'}
{currency: 'USD'},
{payment_schedule: []}
]);
},
() => frappe.timeout(1),

View File

@ -16,13 +16,15 @@ QUnit.test("test sales order with additional discount in grand total", function(
]},
{customer_address: 'Test1-Billing'},
{shipping_address_name: 'Test1-Shipping'},
{contact_person: 'Contact 1-Test Customer 1'}
{contact_person: 'Contact 1-Test Customer 1'},
{payment_terms_template: '_Test Payment Term Template UI'}
]);
},
() => {
return frappe.tests.set_form_values(cur_frm, [
{apply_discount_on:'Grand Total'},
{additional_discount_percentage:10}
{additional_discount_percentage:10},
{payment_schedule: []}
]);
},
() => cur_frm.save(),

View File

@ -18,7 +18,8 @@ QUnit.test("test sales order", function(assert) {
]},
{customer_address: 'Test1-Billing'},
{shipping_address_name: 'Test1-Shipping'},
{contact_person: 'Contact 1-Test Customer 1'}
{contact_person: 'Contact 1-Test Customer 1'},
{payment_terms_template: '_Test Payment Term Template UI'}
]);
},
() => cur_frm.save(),

View File

@ -217,6 +217,25 @@ $.extend(frappe.test_data, {
{price_list: '_Test Price List'},
{price_list_rate: 200}
]
},
"Payment Term": {
"_Test Payment Term": [
{payment_term_name: '_Test Payment Term'},
{due_date_based_on: 'Day(s) after invoice date'},
{invoice_portion: 100},
{credit_days: 0}
]
},
"Payment Terms Template": {
"_Test Payment Term Template UI": [
{template_name: "_Test Payment Term Template UI"},
{terms: [
[
{payment_term: '_Test Payment Term'},
{invoice_portion: 100}
]
]}
]
}
});