feat: add pagination buttons

This commit is contained in:
Chen, Tai-Lin committed 2023-12-21 17:48:36 +08:00
1 parent fa36b63fbe
commit 3b68693177
8 files changed
+52 -19

No files matched your search

+2 -1
View File
@@ -3,7 +3,8 @@ import Pagination, { ASC, DESC } from '../src/models/pagination.js'
describe('Pagination', () => {
it('should failed when not provide order', () => {
expect(() => new Pagination()).toThrow('order must be asc or desc')
expect(new Pagination('').getOrder()).toBe(DESC)
expect(() => new Pagination('Hahaha')).toThrow()
})
it('should return correct limit', () => {
const pagination = new Pagination(DESC, 10)