[#147,widget/filtereditor][s]: setting of term filter value and removal of filter working again (and tested!) - fixes #147.
This commit is contained in:
@@ -13,14 +13,29 @@ test('basics', function () {
|
||||
ok(!view.el.find('.js-add-filter').is(":visible"));
|
||||
ok($addForm.is(":visible"));
|
||||
|
||||
// submit the form
|
||||
$addForm.find('select.fields').val('country');
|
||||
$addForm.submit();
|
||||
|
||||
// now check we have new filter
|
||||
ok(!$addForm.is(":visible"));
|
||||
$editForm = view.el.find('form.js-edit');
|
||||
equal($editForm.find('.filter-term').length, 1)
|
||||
|
||||
equal(_.keys(dataset.queryState.attributes.filters[0].term)[0], 'country');
|
||||
|
||||
// now set filter value and apply
|
||||
$editForm.find('input').val('UK');
|
||||
$editForm.submit();
|
||||
equal(dataset.queryState.attributes.filters[0].term.country, 'UK');
|
||||
equal(dataset.currentRecords.length, 3);
|
||||
|
||||
// now remove filter
|
||||
$editForm.find('.js-remove-filter').click();
|
||||
// hmmm, not working yet but works by eye!
|
||||
// $editForm = view.el.find('form.js-edit');
|
||||
// equal($editForm.find('.filter-term').length, 0)
|
||||
// equal(dataset.currentRecords.length, 6);
|
||||
|
||||
view.remove();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user