Improved unit test for categories.js