diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note.js b/erpnext/stock/doctype/delivery_note/test_delivery_note.js new file mode 100644 index 0000000000..482f892997 --- /dev/null +++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.js @@ -0,0 +1,37 @@ +QUnit.module('Stock'); + +QUnit.test("test delivery note", function(assert) { + assert.expect(2); + let done = assert.async(); + frappe.run_serially([ + () => { + return frappe.tests.make('Delivery Note', [ + {customer:'Test Customer 1'}, + {items: [ + [ + {'item_code': 'Test Product 1'}, + {'qty': 5}, + ] + ]}, + {shipping_address_name: 'Test1-Shipping'}, + {contact_person: 'Contact 1-Test Customer 1'}, + {taxes_and_charges: 'TEST In State GST'}, + {tc_name: 'Test Term 1'}, + {transporter_name:'TEST TRANSPORT'}, + {lr_no:'MH-04-FG 1111'} + ]); + }, + () => cur_frm.save(), + () => { + // get_item_details + assert.ok(cur_frm.doc.items[0].item_name=='Test Product 1', "Item name correct"); + assert.ok(cur_frm.doc.grand_total==590, " Grand Total correct"); + }, + () => frappe.tests.click_button('Submit'), + () => frappe.tests.click_button('Yes'), + () => frappe.timeout(0.3), + () => done() + ]); +}); + + diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt index 6d9594dd40..e962ea62d6 100644 --- a/erpnext/tests/ui/tests.txt +++ b/erpnext/tests/ui/tests.txt @@ -51,6 +51,7 @@ erpnext/stock/doctype/warehouse/test_warehouse.js erpnext/manufacturing/doctype/production_order/test_production_order.js #long erpnext/accounts/page/pos/test_pos.js erpnext/selling/doctype/product_bundle/test_product_bundle.js +erpnext/stock/doctype/delivery_note/test_delivery_note.js erpnext/stock/doctype/material_request/tests/test_material_request.js erpnext/stock/doctype/material_request/tests/test_material_request_type_material_issue.js erpnext/stock/doctype/material_request/tests/test_material_request_type_material_transfer.js