mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 22:51:30 -07:00
maybe fix balance issue, add charades words
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { Hono } from 'hono'
|
||||
|
||||
import charadesWords from '../../static/charades.json'
|
||||
|
||||
import type { App } from '../context'
|
||||
|
||||
// Text sanitization, keepsakes, objectives/events/rewards, and the misc
|
||||
@@ -13,6 +15,11 @@ export const gameplayRoutes = new Hono<App>({ strict: false })
|
||||
})
|
||||
.post('/api/sanitize/v1/isPure', (c) => c.json({ IsPure: true }))
|
||||
|
||||
// ---- Activities -----------------------------------------------------------
|
||||
// Word bank for the Charades activity. The client requests the list by
|
||||
// activity name (`.../words/Charades`); other activities have no data yet.
|
||||
.get('/api/activities/charades/v1/words/:activity', (c) => c.json(charadesWords))
|
||||
|
||||
// Keepsakes (room mementos). Stubbed empty.
|
||||
.get('/api/keepsakes/globalconfig', (c) =>
|
||||
c.json({ KeepsakeFeatureEnabled: true, KeepsakeRoomLimit: 10, SocialXpBoostEnabled: false })
|
||||
|
||||
@@ -190,6 +190,15 @@ describe('public endpoints', () => {
|
||||
})
|
||||
})
|
||||
|
||||
test('GET /api/activities/charades/v1/words/Charades returns the word bank', async () => {
|
||||
const res = await exports.default.fetch(`${ORIGIN}/api/activities/charades/v1/words/Charades`)
|
||||
expect(res.status).toBe(200)
|
||||
const words = (await res.json()) as Array<{ Id: number; Difficulty: number; EN_US: string }>
|
||||
expect(Array.isArray(words)).toBe(true)
|
||||
expect(words.length).toBeGreaterThan(0)
|
||||
expect(words[0]).toEqual({ Id: 1, Difficulty: 0, EN_US: 'David Bowie' })
|
||||
})
|
||||
|
||||
test('GET /api/playerevents/v1/clubs returns an empty event list', async () => {
|
||||
// The client deserializes this as a bare array — an envelope here fails with
|
||||
// "expected:'[', actual:'{'". No player-event storage yet → empty.
|
||||
|
||||
Reference in New Issue
Block a user