修复feifei领取链接直返
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
|
||||
import { resolveKuaishouFeifeiClaimUrl } from './index.js'
|
||||
|
||||
test('resolveKuaishouFeifeiClaimUrl prefers feifei h5 url over local claim url', () => {
|
||||
assert.equal(
|
||||
resolveKuaishouFeifeiClaimUrl({
|
||||
claimUrl: 'https://ks.khhao.com/#/claim/local-token',
|
||||
h5: {
|
||||
entryUrl: 'https://feifei.example.com/h5/exchange',
|
||||
rechargeUrl: 'https://feifei.example.com/h5/bind?code=abc',
|
||||
},
|
||||
}),
|
||||
'https://feifei.example.com/h5/bind?code=abc',
|
||||
)
|
||||
})
|
||||
|
||||
test('resolveKuaishouFeifeiClaimUrl does not expose local claim token fallback', () => {
|
||||
assert.equal(
|
||||
resolveKuaishouFeifeiClaimUrl({
|
||||
claimUrl: 'local-token',
|
||||
h5: {},
|
||||
}),
|
||||
'',
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user