feat(M08-B): 补任务免清洁
This commit is contained in:
@@ -94,6 +94,10 @@ const app = await buildApp({
|
||||
calls.push(['reject', input]);
|
||||
return { ...task('REJECTED'), rejectReason: input.reason };
|
||||
},
|
||||
async exempt(input) {
|
||||
calls.push(['exempt', input]);
|
||||
return { ...task('EXEMPT'), rewardCents: 0 };
|
||||
},
|
||||
async listMembers(input) {
|
||||
calls.push(['listMembers', input]);
|
||||
return [member('LEAD', '31', 500), member('ASSIST', '33', 100)];
|
||||
@@ -410,6 +414,17 @@ assert.equal(reject.statusCode, 200);
|
||||
assert.equal(calls.at(-1)[0], 'reject');
|
||||
assert.equal(calls.at(-1)[1].reason, 'photo is unclear');
|
||||
|
||||
const exempt = await app.inject({
|
||||
method: 'POST',
|
||||
url: '/admin-api/cleaning/tasks/101/exempt',
|
||||
headers: { authorization: `Bearer ${token}` },
|
||||
payload: { note: 'no cleaning required' }
|
||||
});
|
||||
assert.equal(exempt.statusCode, 200);
|
||||
assert.equal(exempt.json().data.status, 'EXEMPT');
|
||||
assert.equal(calls.at(-1)[0], 'exempt');
|
||||
assert.equal(calls.at(-1)[1].note, 'no cleaning required');
|
||||
|
||||
const members = await app.inject({
|
||||
method: 'GET',
|
||||
url: '/admin-api/cleaning/tasks/101/members',
|
||||
|
||||
Reference in New Issue
Block a user