add unit tests for pagination