test: group by type