From da2164373cb04011db9caab993e5662b6919f2c9 Mon Sep 17 00:00:00 2001 From: Vishal Dhayagude Date: Mon, 28 Aug 2017 11:10:26 +0530 Subject: [PATCH] [UI Test] UI Test added for Batch (#10564) --- erpnext/stock/doctype/batch/test_batch.js | 23 +++++++++++++++++++++++ erpnext/tests/ui/tests.txt | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 erpnext/stock/doctype/batch/test_batch.js diff --git a/erpnext/stock/doctype/batch/test_batch.js b/erpnext/stock/doctype/batch/test_batch.js new file mode 100644 index 0000000000..af7f50ff91 --- /dev/null +++ b/erpnext/stock/doctype/batch/test_batch.js @@ -0,0 +1,23 @@ +QUnit.module('Stock'); + +QUnit.test("test Batch", function(assert) { + assert.expect(1); + let done = assert.async(); + frappe.run_serially([ + () => { + return frappe.tests.make('Batch', [ + {batch_id:'TEST-BATCH-001'}, + {item:'Test Product 4'}, + {expiry_date:frappe.datetime.add_days(frappe.datetime.now_date(), 2)}, + ]); + }, + () => cur_frm.save(), + () => { + // get_item_details + assert.ok(cur_frm.doc.batch_id=='TEST-BATCH-001', "Batch Id correct"); + }, + () => frappe.timeout(0.3), + () => done() + ]); +}); + diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt index a8b8d7e41a..d1dc96cbe1 100644 --- a/erpnext/tests/ui/tests.txt +++ b/erpnext/tests/ui/tests.txt @@ -112,4 +112,5 @@ erpnext/schools/doctype/assessment_result_tool/test_assessment_result_tool.js erpnext/accounts/doctype/journal_entry/test_journal_entry.js erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js -erpnext/selling/doctype/quotation/tests/test_quotation_submit_cancel_amend.js \ No newline at end of file +erpnext/selling/doctype/quotation/tests/test_quotation_submit_cancel_amend.js +erpnext/stock/doctype/batch/test_batch.js \ No newline at end of file