From f51a57e0b92c893f4ba08f3142ea23c68be94138 Mon Sep 17 00:00:00 2001 From: Johnson Liang Date: Wed, 3 Jan 2024 16:25:58 +0800 Subject: [PATCH] fix(webhook): update snapshot on new askingArticleSubmissionConsent input format --- .../__tests__/__snapshots__/choosingArticle.test.ts.snap | 4 ++-- src/webhook/handlers/__tests__/askingArticleSource.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/webhook/handlers/__tests__/__snapshots__/choosingArticle.test.ts.snap b/src/webhook/handlers/__tests__/__snapshots__/choosingArticle.test.ts.snap index 37388e31..e96c1414 100644 --- a/src/webhook/handlers/__tests__/__snapshots__/choosingArticle.test.ts.snap +++ b/src/webhook/handlers/__tests__/__snapshots__/choosingArticle.test.ts.snap @@ -156,7 +156,7 @@ Do you want someone to fact-check this message?", "contents": Array [ Object { "action": Object { - "data": "{\\"input\\":\\"__POSTBACK_YES__\\",\\"sessionId\\":0,\\"state\\":\\"ASKING_ARTICLE_SUBMISSION_CONSENT\\"}", + "data": "{\\"input\\":[0],\\"sessionId\\":0,\\"state\\":\\"ASKING_ARTICLE_SUBMISSION_CONSENT\\"}", "displayText": "🆕 Report to database", "label": "🆕 Report to database", "type": "postback", @@ -167,7 +167,7 @@ Do you want someone to fact-check this message?", }, Object { "action": Object { - "data": "{\\"input\\":\\"__POSTBACK_NO__\\",\\"sessionId\\":0,\\"state\\":\\"ASKING_ARTICLE_SUBMISSION_CONSENT\\"}", + "data": "{\\"input\\":[],\\"sessionId\\":0,\\"state\\":\\"ASKING_ARTICLE_SUBMISSION_CONSENT\\"}", "displayText": "Don’t report", "label": "Don’t report", "type": "postback", diff --git a/src/webhook/handlers/__tests__/askingArticleSource.test.ts b/src/webhook/handlers/__tests__/askingArticleSource.test.ts index 8917d7fb..7000acc3 100644 --- a/src/webhook/handlers/__tests__/askingArticleSource.test.ts +++ b/src/webhook/handlers/__tests__/askingArticleSource.test.ts @@ -295,7 +295,7 @@ it('sends user submission consent if user forwarded the whole message', async () "contents": Array [ Object { "action": Object { - "data": "{\\"input\\":\\"__POSTBACK_YES__\\",\\"sessionId\\":0,\\"state\\":\\"ASKING_ARTICLE_SUBMISSION_CONSENT\\"}", + "data": "{\\"input\\":[0],\\"sessionId\\":0,\\"state\\":\\"ASKING_ARTICLE_SUBMISSION_CONSENT\\"}", "displayText": "🆕 Report to database", "label": "🆕 Report to database", "type": "postback", @@ -306,7 +306,7 @@ it('sends user submission consent if user forwarded the whole message', async () }, Object { "action": Object { - "data": "{\\"input\\":\\"__POSTBACK_NO__\\",\\"sessionId\\":0,\\"state\\":\\"ASKING_ARTICLE_SUBMISSION_CONSENT\\"}", + "data": "{\\"input\\":[],\\"sessionId\\":0,\\"state\\":\\"ASKING_ARTICLE_SUBMISSION_CONSENT\\"}", "displayText": "Don’t report", "label": "Don’t report", "type": "postback",