page tests

This commit is contained in:
Gauthier Roebroeck 2026-01-30 12:13:48 +08:00
parent b94402a64e
commit dc7638cf52

View file

@ -2,32 +2,32 @@ import { describe, expect, test } from 'vitest'
import * as v from 'valibot'
import { SchemaStrictlyPositive } from '@/types/page'
describe('pagination composable', () => {
test('page=1', () => {
describe('schema strictly positive', () => {
test('1', () => {
const result = v.parse(SchemaStrictlyPositive, '1')
expect(result).toStrictEqual(1)
})
test('page=5', () => {
test('5', () => {
const result = v.parse(SchemaStrictlyPositive, '5')
expect(result).toStrictEqual(5)
})
test('page=0', () => {
test('0', () => {
const result = v.parse(SchemaStrictlyPositive, '0')
expect(result).toStrictEqual(1)
})
test('page=-25', () => {
test('-25', () => {
const result = v.parse(SchemaStrictlyPositive, '')
expect(result).toStrictEqual(1)
})
test('page=string', () => {
test('string', () => {
const result = v.parse(SchemaStrictlyPositive, 'some string')
expect(result).toStrictEqual(1)