TST: tests for categorical apply
- [x] closes #20714
- [x] tests added / passed

[This issue](https://github.com/pandas-dev/pandas/pull/24275/files) fixed the underlying problem highlighted in #20714 . Added the appropriate test cases so we can close this.
