test for sortByTotal