完成80%
This commit is contained in:
@@ -197,6 +197,54 @@ const run = async () => {
|
||||
(error) => error?.code === "GENEALOGY_RESPONSE_INVALID",
|
||||
);
|
||||
|
||||
nextResponse = {
|
||||
statusCode: 200,
|
||||
data: { code: 200, data: 7 },
|
||||
};
|
||||
assert.strictEqual(await appApi.getUnreadNotificationCount(), 7);
|
||||
assert.strictEqual(
|
||||
requests.at(-1).url,
|
||||
"https://backend-api.ddxcjp.cn/genealogy/app/notifications/unread-count",
|
||||
);
|
||||
|
||||
nextResponse = {
|
||||
statusCode: 200,
|
||||
data: { code: 200, data: -1 },
|
||||
};
|
||||
await assert.rejects(
|
||||
appApi.getUnreadNotificationCount(),
|
||||
(error) => error?.code === "NOTIFICATION_COUNT_RESPONSE_INVALID",
|
||||
);
|
||||
|
||||
const quota = {
|
||||
createUsed: 1,
|
||||
createLimit: 3,
|
||||
createRemaining: 2,
|
||||
canCreate: true,
|
||||
joinUsed: 2,
|
||||
joinLimit: 10,
|
||||
joinRemaining: 8,
|
||||
canJoin: true,
|
||||
};
|
||||
nextResponse = {
|
||||
statusCode: 200,
|
||||
data: { code: 200, data: quota },
|
||||
};
|
||||
assert.deepStrictEqual(await appApi.getGenealogyQuota(), quota);
|
||||
assert.strictEqual(
|
||||
requests.at(-1).url,
|
||||
"https://backend-api.ddxcjp.cn/genealogy/app/genealogies/quota",
|
||||
);
|
||||
|
||||
nextResponse = {
|
||||
statusCode: 200,
|
||||
data: { code: 200, data: { ...quota, canJoin: undefined } },
|
||||
};
|
||||
await assert.rejects(
|
||||
appApi.getGenealogyQuota(),
|
||||
(error) => error?.code === "GENEALOGY_QUOTA_RESPONSE_INVALID",
|
||||
);
|
||||
|
||||
process.stdout.write("G01-MY-GENEALOGIES-RUNTIME-SMOKE PASS\n");
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user