[fix] test

This commit is contained in:
Rushabh Mehta 2017-08-14 12:09:30 +05:30
parent ea573e2421
commit 1132502e14
2 changed files with 11 additions and 5 deletions

View File

@ -294,6 +294,8 @@ def get_employee_emails(employee_list):
'''Returns list of employee emails either based on user_id or company_email'''
employee_emails = []
for employee in employee_list:
if not employee:
continue
user, email = frappe.db.get_value('Employee', employee, ['user_id', 'company_email'])
if user or email:
employee_emails.append(user or email)

View File

@ -11,20 +11,24 @@ QUnit.test("test: Training Event", function (assert) {
() => frappe.new_doc("Training Event"),
() => frappe.timeout(1),
() => frappe.click_link('Edit in full page'),
() => cur_frm.set_value("event_name", "Test Event"),
() => cur_frm.set_value("event_name", "Test Event " + frappe.utils.get_random(10)),
() => cur_frm.set_value("start_time", "2017-07-26, 2:00 pm PDT"),
() => cur_frm.set_value("end_time", "2017-07-26, 2:30 pm PDT"),
() => cur_frm.set_value("introduction", "This is a test report"),
() => cur_frm.set_value("location", "Fake office"),
() => cur_frm.set_value("send_email", 0),
() => frappe.click_button('Add Row'),
() => frappe.db.get_value('Employee', {'employee_name':'Test Employee 1'}, 'name'),
(r) => {
console.log(r);
return cur_frm.fields_dict.employees.grid.grid_rows[0].doc.employee = r.message.name;
},
() => {
cur_frm.fields_dict.employees.grid.grid_rows[0].doc.attendance = "Optional";
return cur_frm.fields_dict.employees.grid.grid_rows[0].doc.attendance = "Optional";
},
() => frappe.click_button('Save'),
() => frappe.timeout(1),
() => frappe.timeout(2),
() => frappe.click_button('Submit'),
() => frappe.timeout(1),
() => frappe.timeout(2),
() => frappe.click_button('Yes'),
() => frappe.timeout(1),
() => {