mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 17:04:47 +00:00
chore: drop deprecated qunit tests
This commit is contained in:
committed by
Ankush Menat
parent
107b404105
commit
f5d5281119
@@ -1,43 +0,0 @@
|
||||
QUnit.module("sales");
|
||||
|
||||
QUnit.test("test: lead", function (assert) {
|
||||
assert.expect(4);
|
||||
let done = assert.async();
|
||||
let lead_name = frappe.utils.get_random(10);
|
||||
frappe.run_serially([
|
||||
// test lead creation
|
||||
() => frappe.set_route("List", "Lead"),
|
||||
() => frappe.new_doc("Lead"),
|
||||
() => frappe.timeout(1),
|
||||
() => cur_frm.set_value("lead_name", lead_name),
|
||||
() => cur_frm.save(),
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.lead_name.includes(lead_name),
|
||||
'name correctly set');
|
||||
frappe.lead_name = cur_frm.doc.name;
|
||||
},
|
||||
// create address and contact
|
||||
() => frappe.click_link('Address & Contact'),
|
||||
() => frappe.click_button('New Address'),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.set_control('address_line1', 'Gateway'),
|
||||
() => frappe.set_control('city', 'Mumbai'),
|
||||
() => cur_frm.save(),
|
||||
() => frappe.timeout(3),
|
||||
() => assert.equal(frappe.get_route()[1], 'Lead',
|
||||
'back to lead form'),
|
||||
() => frappe.click_link('Address & Contact'),
|
||||
() => assert.ok($('.address-box').text().includes('Mumbai'),
|
||||
'city is seen in address box'),
|
||||
|
||||
// make opportunity
|
||||
() => frappe.click_button('Make'),
|
||||
() => frappe.click_link('Opportunity'),
|
||||
() => frappe.timeout(2),
|
||||
() => assert.equal(cur_frm.doc.lead, frappe.lead_name,
|
||||
'lead name correctly mapped'),
|
||||
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
@@ -1,55 +0,0 @@
|
||||
QUnit.module("sales");
|
||||
|
||||
QUnit.test("test: lead", function (assert) {
|
||||
assert.expect(5);
|
||||
let done = assert.async();
|
||||
let lead_name = frappe.utils.get_random(10);
|
||||
frappe.run_serially([
|
||||
// test lead creation
|
||||
() => frappe.set_route("List", "Lead"),
|
||||
() => frappe.new_doc("Lead"),
|
||||
() => frappe.timeout(1),
|
||||
() => cur_frm.set_value("company_name", lead_name),
|
||||
() => cur_frm.save(),
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.lead_name.includes(lead_name),
|
||||
'name correctly set');
|
||||
frappe.lead_name = cur_frm.doc.name;
|
||||
},
|
||||
// create address and contact
|
||||
() => frappe.click_link('Address & Contact'),
|
||||
() => frappe.click_button('New Address'),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.set_control('address_line1', 'Gateway'),
|
||||
() => frappe.set_control('city', 'Mumbai'),
|
||||
() => cur_frm.save(),
|
||||
() => frappe.timeout(3),
|
||||
() => assert.equal(frappe.get_route()[1], 'Lead',
|
||||
'back to lead form'),
|
||||
() => frappe.click_link('Address & Contact'),
|
||||
() => assert.ok($('.address-box').text().includes('Mumbai'),
|
||||
'city is seen in address box'),
|
||||
|
||||
() => frappe.click_button('New Contact'),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.set_control('first_name', 'John'),
|
||||
() => frappe.set_control('last_name', 'Doe'),
|
||||
() => cur_frm.save(),
|
||||
() => frappe.timeout(3),
|
||||
() => frappe.set_route('Form', 'Lead', cur_frm.doc.links[0].link_name),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_link('Address & Contact'),
|
||||
() => assert.ok($('.address-box').text().includes('John'),
|
||||
'contact is seen in contact box'),
|
||||
|
||||
// make customer
|
||||
() => frappe.click_button('Make'),
|
||||
() => frappe.click_link('Customer'),
|
||||
() => frappe.timeout(2),
|
||||
() => assert.equal(cur_frm.doc.lead_name, frappe.lead_name,
|
||||
'lead name correctly mapped'),
|
||||
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
@@ -1,56 +0,0 @@
|
||||
QUnit.test("test: opportunity", function (assert) {
|
||||
assert.expect(8);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => frappe.set_route('List', 'Opportunity'),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_button('New'),
|
||||
() => frappe.timeout(1),
|
||||
() => cur_frm.set_value('opportunity_from', 'Customer'),
|
||||
() => cur_frm.set_value('customer', 'Test Customer 1'),
|
||||
|
||||
// check items
|
||||
() => cur_frm.set_value('with_items', 1),
|
||||
() => frappe.tests.set_grid_values(cur_frm, 'items', [
|
||||
[
|
||||
{item_code:'Test Product 1'},
|
||||
{qty: 4}
|
||||
]
|
||||
]),
|
||||
() => cur_frm.save(),
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
assert.notOk(cur_frm.is_new(), 'saved');
|
||||
frappe.opportunity_name = cur_frm.doc.name;
|
||||
},
|
||||
|
||||
// close and re-open
|
||||
() => frappe.click_button('Close'),
|
||||
() => frappe.timeout(1),
|
||||
() => assert.equal(cur_frm.doc.status, 'Closed',
|
||||
'closed'),
|
||||
|
||||
() => frappe.click_button('Reopen'),
|
||||
() => assert.equal(cur_frm.doc.status, 'Open',
|
||||
'reopened'),
|
||||
() => frappe.timeout(1),
|
||||
|
||||
// make quotation
|
||||
() => frappe.click_button('Make'),
|
||||
() => frappe.click_link('Quotation', 1),
|
||||
() => frappe.timeout(2),
|
||||
() => {
|
||||
assert.equal(frappe.get_route()[1], 'Quotation',
|
||||
'made quotation');
|
||||
assert.equal(cur_frm.doc.customer, 'Test Customer 1',
|
||||
'customer set in quotation');
|
||||
assert.equal(cur_frm.doc.items[0].item_code, 'Test Product 1',
|
||||
'item set in quotation');
|
||||
assert.equal(cur_frm.doc.items[0].qty, 4,
|
||||
'qty set in quotation');
|
||||
assert.equal(cur_frm.doc.items[0].prevdoc_docname, frappe.opportunity_name,
|
||||
'opportunity set in quotation');
|
||||
},
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
Reference in New Issue
Block a user