Skip to content

Commit

Permalink
s/reply_to_broadcast/reply_broadcast/
Browse files Browse the repository at this point in the history
  • Loading branch information
hakatashi committed Oct 2, 2024
1 parent e377a69 commit 7eb44e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions atequiz/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class AteQuiz {
Object.assign(
{},
this.problem.unsolvedMessage,
{ thread_ts, reply_to_broadcast: true },
{ thread_ts, reply_broadcast: true },
)
);

Expand Down Expand Up @@ -222,7 +222,7 @@ export class AteQuiz {
Object.assign(
{},
await this.solvedMessageGen(message),
{ thread_ts, reply_to_broadcast: true },
{ thread_ts, reply_broadcast: true },
)
);

Expand Down
6 changes: 6 additions & 0 deletions wadokaichin/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ describe('wadokaichin works', () => {
expect('username' in response && response.username).toBe('和同開珎');
expect(response.text).toBe(':question:に入る常用漢字は何でしょう?3分以内に答えてね。');
expect(response.thread_ts).toBe(slack.fakeTimestamp);
expect(response.reply_broadcast || false).toBe(false);
}
{
slack.postMessage('山',{thread_ts: slack.fakeTimestamp});
Expand All @@ -65,6 +66,7 @@ describe('wadokaichin works', () => {
expect('username' in response && response.username).toBe('和同開珎');
expect(response.text).toBe(`<@${slack.fakeUser}> 『川』正解🎉\n他にも『海/谷』などが当てはまります。`);
expect(response.thread_ts).toBe(slack.fakeTimestamp);
expect(response.reply_broadcast).toBe(true);
}
});

Expand All @@ -79,12 +81,14 @@ describe('wadokaichin works', () => {
expect('username' in response && response.username).toBe('和同開珎');
expect(response.text).toBe(':question:に入る常用漢字は何でしょう?3分以内に答えてね。');
expect(response.thread_ts).toBe(slack.fakeTimestamp);
expect(response.reply_broadcast || false).toBe(false);
}
{
const response = await slack.getResponseTo('谷山',{thread_ts: slack.fakeTimestamp});
expect('username' in response && response.username).toBe('和同開珎');
expect(response.text).toBe(`<@${slack.fakeUser}> 『谷』正解🎉\n他にも『川/海』などが当てはまります。`);
expect(response.thread_ts).toBe(slack.fakeTimestamp);
expect(response.reply_broadcast).toBe(true);
}
});

Expand All @@ -99,6 +103,7 @@ describe('wadokaichin works', () => {
expect('username' in response && response.username).toBe('和同開珎');
expect(response.text).toBe(':question:に入る常用漢字は何でしょう?3分以内に答えてね。');
expect(response.thread_ts).toBe(slack.fakeTimestamp);
expect(response.reply_broadcast || false).toBe(false);
}
const now = Date.now();
// XXX: context switchを発生させるために無のawaitをしている。もっとよい書き方がありそう。
Expand All @@ -112,6 +117,7 @@ describe('wadokaichin works', () => {
expect('username' in response && response.username).toBe('和同開珎');
expect(response.text).toBe(`時間切れ!\n正解は『川/海/谷』でした。`);
expect(response.thread_ts).toBe(slack.fakeTimestamp);
expect(response.reply_broadcast).toBe(true);
}
});
});

0 comments on commit 7eb44e6

Please sign in to comment.