diff --git a/erpnext/crm/doctype/item/test_item.js b/erpnext/crm/doctype/item/test_item.js index 2f50ebedc32..704e762b1cb 100644 --- a/erpnext/crm/doctype/item/test_item.js +++ b/erpnext/crm/doctype/item/test_item.js @@ -65,6 +65,13 @@ QUnit.test("test: item", function (assert) { {item_group: "Products"} ] ), + () => frappe.tests.make( + "Item", [ + {item_code: "Computer"}, + {item_group: "Products"}, + {is_stock_item: 0}, + ] + ), // Create a scrap item () => frappe.tests.make( diff --git a/erpnext/selling/doctype/product_bundle/test_product_bundle.js b/erpnext/selling/doctype/product_bundle/test_product_bundle.js new file mode 100644 index 00000000000..ba5ba0dc3ba --- /dev/null +++ b/erpnext/selling/doctype/product_bundle/test_product_bundle.js @@ -0,0 +1,36 @@ +QUnit.test("test sales order", function(assert) { + assert.expect(4); + let done = assert.async(); + frappe.run_serially([ + () => { + return frappe.tests.make('Product Bundle', [ + {new_item_code: 'Computer'}, + {items: [ + [ + {item_code:'CPU'}, + {qty:1} + ], + [ + {item_code:'Screen'}, + {qty:1} + ], + [ + {item_code:'Keyboard'}, + {qty:1} + ] + ]}, + ]); + }, + () => cur_frm.save(), + () => { + // get_item_details + assert.ok(cur_frm.doc.items[0].item_code=='CPU', "Item Code correct"); + assert.ok(cur_frm.doc.items[1].item_code=='Screen', "Item Code correct"); + assert.ok(cur_frm.doc.items[2].item_code=='Keyboard', "Item Code correct"); + assert.ok(cur_frm.doc.new_item_code == "Computer", "Parent Item correct"); + }, + () => frappe.timeout(0.3), + () => done() + ]); +}); + diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt index b86f1eefd4e..60ca47cfda0 100644 --- a/erpnext/tests/ui/tests.txt +++ b/erpnext/tests/ui/tests.txt @@ -29,4 +29,5 @@ erpnext/schools/doctype/school_settings/test_school_settings.js erpnext/schools/doctype/student_batch_name/test_student_batch_name.js erpnext/schools/doctype/student_category/test_student_category.js erpnext/schools/doctype/room/test_room.js -erpnext/schools/doctype/instructor/test_instructor.js \ No newline at end of file +erpnext/schools/doctype/instructor/test_instructor.js +erpnext/selling/doctype/product_bundle/test_product_bundle.js \ No newline at end of file