mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 19:34:02 +00:00
feat(miniapp): add member rent weight controls
This commit is contained in:
@@ -73,6 +73,15 @@ describe('createBotWebhookServer', () => {
|
||||
}
|
||||
})
|
||||
},
|
||||
miniAppUpdateMemberRentWeight: {
|
||||
handler: async () =>
|
||||
new Response(JSON.stringify({ ok: true, authorized: true, member: {} }), {
|
||||
status: 200,
|
||||
headers: {
|
||||
'content-type': 'application/json; charset=utf-8'
|
||||
}
|
||||
})
|
||||
},
|
||||
miniAppBillingCycle: {
|
||||
handler: async () =>
|
||||
new Response(JSON.stringify({ ok: true, authorized: true, cycleState: {} }), {
|
||||
@@ -304,6 +313,22 @@ describe('createBotWebhookServer', () => {
|
||||
})
|
||||
})
|
||||
|
||||
test('accepts mini app rent weight update request', async () => {
|
||||
const response = await server.fetch(
|
||||
new Request('http://localhost/api/miniapp/admin/members/rent-weight', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ initData: 'payload' })
|
||||
})
|
||||
)
|
||||
|
||||
expect(response.status).toBe(200)
|
||||
expect(await response.json()).toEqual({
|
||||
ok: true,
|
||||
authorized: true,
|
||||
member: {}
|
||||
})
|
||||
})
|
||||
|
||||
test('accepts mini app billing cycle request', async () => {
|
||||
const response = await server.fetch(
|
||||
new Request('http://localhost/api/miniapp/admin/billing-cycle', {
|
||||
|
||||
Reference in New Issue
Block a user