Rosetta Code: Top rank per group

Hi!
Does anyone know what the output for “Top rank per group” is supposed to be?
I am outputting an array of objects, e.g. for:
topRankPerGroup(1, data, 'genre', 'rating')
the output is following:
0: Object { name: "Friday 13th", genre: "horror", rating: 9.9 },
1: Object { name: "Blade runner", genre: "scifi", rating: 8.9 },
2: Object { name: "Titanic", genre: "drama", rating: 7.3 }
and for:
topRankPerGroup(2, data, 'dept', 'salary');
it is this array of objects:
0: Object { name: "Kim Arlich", id: "E10001", salary: 57000, … }
1: Object { name: "George Woltman", id: "E00127", salary: 53500, … }
2: Object { name: "Rich Holcomb", id: "E01234", salary: 49500, … }
3: Object { name: "John Rappl", id: "E21437", salary: 47000, … }
4: Object { name: "David McClellan", id: "E04242", salary: 41500, … },
5: Object { name: "Timothy Grove", id: "E16398", salary: 29900, … },
6: Object { name: "Claire Buckman", id: "E39876", salary: 27800, … },
7: Object { name: "Nathan Adams", id: "E41298", salary: 21900, … }

However it doesn’t pass the freecodecamp tests and I can’t find them anywhere.

Any help would be much appreciated!
Thanks in advance!

The output is supposed to be a nested array of object items for each group. The example output below will make more sense to look at.

Example Output:

[
  [{ name: 'George Woltman', id: 'E00127', salary: 53500, dept: 'D101' },
    { name: 'David McClellan', id: 'E04242', salary: 41500, dept: 'D101' }]
]

I hit the same issue not knowing what the output was supposed to look like after I had finished sorting everything out. I ended up looking at the test code to see how the tests were referencing the return value.