优化兑换成功后截图逻辑
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
|
||||
import { shouldCaptureBeijingTimeProof } from './session-proof.js'
|
||||
|
||||
test('shouldCaptureBeijingTimeProof only returns true for successful redeem results', () => {
|
||||
assert.equal(
|
||||
shouldCaptureBeijingTimeProof({
|
||||
classification: {
|
||||
success: true,
|
||||
},
|
||||
}),
|
||||
true,
|
||||
)
|
||||
|
||||
assert.equal(
|
||||
shouldCaptureBeijingTimeProof({
|
||||
classification: {
|
||||
success: false,
|
||||
},
|
||||
}),
|
||||
false,
|
||||
)
|
||||
|
||||
assert.equal(
|
||||
shouldCaptureBeijingTimeProof({
|
||||
redeem: {
|
||||
iRet: 0,
|
||||
},
|
||||
}),
|
||||
true,
|
||||
)
|
||||
|
||||
assert.equal(
|
||||
shouldCaptureBeijingTimeProof({
|
||||
redeem: {
|
||||
iRet: -183,
|
||||
},
|
||||
}),
|
||||
false,
|
||||
)
|
||||
|
||||
assert.equal(shouldCaptureBeijingTimeProof(null), false)
|
||||
})
|
||||
Reference in New Issue
Block a user