Rushabh Mehta | 43ef4e9 | 2017-07-03 11:53:07 +0530 | [diff] [blame] | 1 | QUnit.module('sales'); |
| 2 | |
| 3 | QUnit.test("test quotation", function(assert) { |
| 4 | assert.expect(2); |
| 5 | let done = assert.async(); |
| 6 | frappe.run_serially([ |
| 7 | () => frappe.tests.setup_doctype('Customer'), |
| 8 | () => frappe.tests.setup_doctype('Item'), |
| 9 | () => { |
| 10 | return frappe.tests.make('Quotation', [ |
| 11 | {customer: 'Test Customer 1'}, |
| 12 | {items: [ |
| 13 | [ |
| 14 | {'item_code': 'Test Product 1'}, |
| 15 | {'qty': 5} |
| 16 | ] |
| 17 | ]} |
| 18 | ]); |
| 19 | }, |
| 20 | () => { |
| 21 | // get_item_details |
| 22 | assert.ok(cur_frm.doc.items[0].item_name=='Test Product 1'); |
| 23 | |
| 24 | // calculate_taxes_and_totals |
| 25 | assert.ok(cur_frm.doc.grand_total==500); |
| 26 | }, |
| 27 | () => done() |
| 28 | ]); |
| 29 | }); |