TST: added test for to_json when called on numbers exceeding the int64 limit


- [x] closes #21073
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) 
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Added test for to_json() when called on numbers exceeding the int64 limit.
Tests and linter pass locally.
Thanks @johnmantios 