fix(dakao): hide started matches from schedule
This commit is contained in:
1 parent
a4215f86fb
commit
ca786fd80a
3 files changed
+96
No files matched your search
@@ -22,6 +22,33 @@ function makeHandler(params: {
|
||||
}
|
||||
|
||||
describe('MatchListHandler', () => {
|
||||
afterEach(() => {
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
it('queries only matches scheduled at or after command processing time', async () => {
|
||||
const now = new Date('2026-07-25T07:30:00.000Z');
|
||||
jest.useFakeTimers().setSystemTime(now);
|
||||
const communityId = objectId('111111111111111111111111');
|
||||
const list = jest.fn().mockResolvedValue([]);
|
||||
const handler = makeHandler({
|
||||
matchService: { list },
|
||||
});
|
||||
|
||||
await handler.handle({
|
||||
communityId,
|
||||
senderUserId: 'kakao-user-1',
|
||||
senderNickname: '프리리',
|
||||
});
|
||||
|
||||
expect(list).toHaveBeenCalledWith({
|
||||
communityId,
|
||||
status: 'recruiting',
|
||||
scheduledFrom: now,
|
||||
limit: 10,
|
||||
});
|
||||
});
|
||||
|
||||
it('prints short codes, compact KST dates, and short links', async () => {
|
||||
const match = {
|
||||
_id: objectId('333333333333333333333333'),
|
||||
|
||||
@@ -19,9 +19,11 @@ export class MatchListHandler {
|
||||
senderUserId: string;
|
||||
senderNickname: string;
|
||||
}): Promise<DakaoSegment[]> {
|
||||
const scheduledFrom = new Date();
|
||||
const matches = await this.matchService.list({
|
||||
communityId: params.communityId,
|
||||
status: 'recruiting',
|
||||
scheduledFrom,
|
||||
limit: 10,
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user