
QUnit.test("test: Event", function (assert) {
	let done = assert.async();

	// number of asserts
	assert.expect(4);

	const subject = '_Test Event 1';
	const datetime = frappe.datetime.now_datetime();
	const hex = '#6be273';
	const rgb = 'rgb(107, 226, 115)';

	frappe.run_serially([
		// insert a new Event
		() => frappe.tests.make('Event', [
			// values to be set
			{subject: subject},
			{starts_on: datetime},
			{color: hex}
		]),
		() => {
			assert.equal(cur_frm.doc.subject, subject, 'Subject correctly set');
			assert.equal(cur_frm.doc.starts_on, datetime, 'Date correctly set');
			assert.equal(cur_frm.doc.color, hex, 'Color correctly set');
		},
		() => frappe.set_route('List', 'Event', 'Calendar'),
		() => frappe.timeout(2),
		() => {
			const bg_color = $(`.result-list:visible .fc-day-grid-event:contains("${subject}")`)
				.css('background-color');
			assert.equal(bg_color, rgb, 'Event background color is set correctly');
		},
		() => done()
	]);

});

@@ -426,16 +426,44 @@
 or: hex%7D
+,%0A%09%09%09%7Bevent_type: 'Private'%7D
 %0A%09%09%5D),%0A%09
@@ -678,16 +678,120 @@
 y set');
+%0A%0A%09%09%09// set filters explicitly for list view%0A%09%09%09frappe.route_options = %7B%0A%09%09%09%09event_type: 'Private'%0A%09%09%09%7D;
 %0A%09%09%7D,%0A%09%09

fix event test (#3868)