write tests for pagination