blob: 5543a67e199063cfb8db04d500a03c8668ff25fa [file] [log] [blame]
Rushabh Mehta43ef4e92017-07-03 11:53:07 +05301QUnit.module('sales');
2
3QUnit.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});