There should be tests (here or elsewhere) for edge case and non-edge case on joins -- with where and/or on filters that reference:
1.  only a group by column (gb = constant)
2.  only an agg column (agg = constant)
3.  only a column of the other table (other = constant)
4,5,6. each two-way combination of these: (gb = agg, other=agg, other=gb)
7-24. each two-way AND combination of the 6 simple filters above.
25-54. each two-way combination with one of the 6 simple filters above in the WHERE clause and one in the ON clause.

SOME of these are already covered, but I don't think that they are ALL covered yet.