import assert from 'node:assert/strict'
import test from 'node:test'

import { buildWorkerOrderQuery } from '../src/utils/worker-order-query.ts'

test('打手订单页按普通状态筛选并保留分页参数', () => {
  assert.deepEqual(buildWorkerOrderQuery('in_progress', '王者荣耀', 2, 20), {
    status: 'in_progress',
    keyword: '王者荣耀',
    page: 2,
    pageSize: 20,
  })
})

test('打手订单页待补图筛选使用独立标记', () => {
  assert.deepEqual(buildWorkerOrderQuery('vip_evidence_pending', '', 1, 20), {
    vipEvidencePending: true,
    keyword: '',
    page: 1,
    pageSize: 20,
  })
})

test('打手订单页选择全部订单时不附加状态筛选值', () => {
  assert.deepEqual(buildWorkerOrderQuery('', '', 1, 20), {
    status: '',
    keyword: '',
    page: 1,
    pageSize: 20,
  })
})
