FIX: do not publish all categories when a category changes.

minor fixes to UI, still needs more work for live refresh of category listing
This commit is contained in:
Sam
2015-07-10 12:09:43 +10:00
parent 4b5354a99e
commit f533276507
6 changed files with 65 additions and 19 deletions

View File

@ -24,6 +24,7 @@ test('create categories', function() {
});
var categories = site.get('categories');
site.get('sortedCategories');
present(categories, "The categories are present");
equal(categories.length, 3, "it loaded all three categories");
@ -36,4 +37,11 @@ test('create categories', function() {
present(subcategory, "it loaded the subcategory");
equal(subcategory.get('parentCategory'), parent, "it has associated the child with the parent");
// remove invalid category and child
categories.removeObject(categories[2]);
categories.removeObject(categories[1]);
equal(categories.length, site.get('categoriesByCount').length, "categories by count should change on removal");
equal(categories.length, site.get('sortedCategories').length, "sorted categories should change on removal");
});