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

import { isAffiliateDashSuccessResponse } from './http-client.js'

test('isAffiliateDashSuccessResponse accepts code 0 and rejects others', () => {
  assert.equal(isAffiliateDashSuccessResponse({ code: 0, message: 'ok' }), true)
  assert.equal(isAffiliateDashSuccessResponse({ code: 0 }), true)
  assert.equal(isAffiliateDashSuccessResponse({ code: 1, message: '余额不足' }), false)
  assert.equal(isAffiliateDashSuccessResponse({ code: 40000, message: '签名校验失败' }), false)
})
