fix: drop qdreader legacy compatibility
This commit is contained in:
@@ -127,33 +127,16 @@ test('bucketGet/bucketSet fallback works when get/set are unavailable in Autman-
|
||||
assert.equal(JSON.parse(bucketStore['hermes_qidian.qdreader_user_bind_json'])['12345'], undefined);
|
||||
});
|
||||
|
||||
test('reads legacy otto bucket but writes new hermes_qidian bucket', () => {
|
||||
test('hermes_qidian bucket values are read and written without legacy bucket fallback', () => {
|
||||
const bucketStore = {
|
||||
'otto.qdreader_cookie_json': JSON.stringify({ '12345': cookie }),
|
||||
'otto.qdreader_user_bind_json': JSON.stringify({ '12345': 'user-a' }),
|
||||
'hermes_qidian.qdreader_cookie_json': JSON.stringify({ '12345': cookie }),
|
||||
'hermes_qidian.qdreader_user_bind_json': JSON.stringify({ '12345': 'user-a' }),
|
||||
};
|
||||
const r = runPlugin({ content: '启点账号', bucketStore, userId: 'user-a', listens: ['3', '1', '主号'] });
|
||||
assert.match(r.replies.join('\n'), /已更新备注/);
|
||||
assert.equal(JSON.parse(r.bucketStore['hermes_qidian.qdreader_remark_json'])['12345'], '主号');
|
||||
});
|
||||
|
||||
test('legacy default sign api base falls back to qdreader path when root /sign is empty', () => {
|
||||
const store = { qdreader_cookie_json: JSON.stringify({ '12345': cookie }), qdreader_sign_api: 'https://api.120399.xyz' };
|
||||
const r = runPlugin({
|
||||
content: '启点签到',
|
||||
store,
|
||||
requests: [
|
||||
{ statusCode: 404, body: '' },
|
||||
{ body: { code: 200, data: { 'QD-Sign': 'sig2' } } },
|
||||
{ statusCode: 200, body: { code: 0, msg: '签到成功' } },
|
||||
],
|
||||
});
|
||||
assert.equal(r.calls.length, 3);
|
||||
assert.match(r.calls[0].url, /api\.120399\.xyz\/sign$/);
|
||||
assert.match(r.calls[1].url, /api\.120399\.xyz\/qdreader\/sign$/);
|
||||
assert.match(r.replies[0], /✅ 12\*\*\*45/);
|
||||
});
|
||||
|
||||
test('qidian request retries transient request errors', () => {
|
||||
const store = { qdreader_cookie_json: JSON.stringify({ '12345': cookie }), qdreader_retry_count: '2' };
|
||||
const r = runPlugin({
|
||||
|
||||
Reference in New Issue
Block a user