From f29533f666db5b670243e7718764c8b36e61349f Mon Sep 17 00:00:00 2001 From: Corina Date: Fri, 18 Jan 2019 13:45:28 -0800 Subject: [PATCH 1/5] Fix suggested-action regression where title does not get added to postback and imback action buttons --- ...n-suggested-actions-are-displayed-1-snap.png | Bin 0 -> 20803 bytes __tests__/suggestedActions.js | 14 ++++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 __tests__/__image_snapshots__/chrome-docker/suggested-actions-js-suggested-actions-command-should-show-correctly-formatted-buttons-when-suggested-actions-are-displayed-1-snap.png diff --git a/__tests__/__image_snapshots__/chrome-docker/suggested-actions-js-suggested-actions-command-should-show-correctly-formatted-buttons-when-suggested-actions-are-displayed-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/suggested-actions-js-suggested-actions-command-should-show-correctly-formatted-buttons-when-suggested-actions-are-displayed-1-snap.png new file mode 100644 index 0000000000000000000000000000000000000000..f5803d155e483d4c8f27c775c4170f3ceb69d57b GIT binary patch literal 20803 zcmeHvbySt_x933+P(VPC4h0ktN$E5QkrIOrX{5VLK9J+J% z`Odv-?)-J<&di#%X00E~KlFHb-{*av9iRQ#pZx|sQ1KoH12k$jFoV3;Bh zmwa%s;ge#j*&GDoCPG&7;Y*j4wFy_PmwV?eTL+y*o%kI-tyw+{3^#LgtER8Vjea!} z=&*WIF_Lc;S20$e=Y)zg%5&0g&#N|c?4RoTYpii+HkdlYC#!@dmnC>@l`DOUe!e=~ z=bBEJ^}d%lohTiTecVQ;P_3YSx8Sm*L{$A zEGy$(b`Z80En895Jy>XZK%&feFm6vMezx16Cx##JDJO@KiAnNAoQsRdeyLkZO>OuU z&A>(Y+dEm(PN-4G@_=53rHG-iF={2zEv!qIE*1O^M;!iiiwa!ljT-sMq|-#N^}w{{C17~_gy_jyY3|prCDdb*%=uRl8xtng#|`L1jNUai;9YJ*-SrRx^qW(SCBJ^NSP5f#Jq3!@q7Fz3{33S zebm@OZ{}kjlWrPr3j7k|E-GSTN`8w3d}{tqtF%vY@mCS7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FG)T*-i zVRe!=YTtA3YN}!j4E>`jz`v?ja-F%34i6!aL0&3m^DC>U$a?+-c1x?;?j3*?2w-p5 ze?Nne2vV4wiV8Av@_5aHjl|Cm2Gz3=DR}w$@20=ed<-xGdWK6b?%t2aMn5?!-`&`^ATjuPlXXh0_|3ln|DrLIp3 zEPk&zz^JVs%y4moP7gH4Z!9d(s0{{iO5OI%AY!zGKDjGPDg>tKuOncv`9MkGo&gL>TBf50KdC(_3Cp)3(prY+y^sW zCLM9?4h{}n5T8MzfbBrfP^gWJ17L+76&M{GgBJtfW(HhyaGZ(&;eXNRX7$L6T^$)EE-fMiaB%e zN(2DIFh=zh=G;IwhJe@%a_mPilL-kHX5~O?;<{Gc0)sw~dsgFCF+gnG+SZl{Djs+q z7-jeYB6Jr>aw8R%)IFj*_<&$paIVozgTAb>r6mAfj{!q?nKZKa4iLT=Lz*AKW`J<* z6C`zz41>OR`R`wScn1uOVoa6hU42!7@v=_9dNQ=n)DT8zK7RUyp4)@Kh}L1C=j1`# z;sGycXcrxIm;Lm759u>CI@%7pBv6d6+=zjpPea%q7+&!1JuxjEae=RH?d-hZ$R%>_ zw&1@HO1RsR`6_I1eDK|KQcs)!c=t^KRn2!nNMGs=D zEf|s@p`q#Yy^IHe2Cw(LN6t{Nf6$OVhPf{g0zP&M`3-rs*rT0a&9M { + test('should show correctly formatted buttons when suggested actions are displayed', async() => { + const { driver } = await setupWebDriver(); + + await sleep(2000); + + const input = await driver.findElement(By.tagName('input[type="text"]')); + + await input.sendKeys('suggested-actions', Key.RETURN); + await sleep(2000); + + const base64PNG = await driver.takeScreenshot(); + + expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); + }, 60000); test('should show response from bot and no text from user on imback', async () => { const { driver } = await setupWebDriver(); From cfb34af54feabbab067e1c9c1ecd0171285ed368 Mon Sep 17 00:00:00 2001 From: Corina Date: Fri, 18 Jan 2019 13:57:22 -0800 Subject: [PATCH 2/5] Fix suggested action regression - title was not being added to postback and imback buttons --- CHANGELOG.md | 1 + packages/component/src/SendBox/SuggestedActions.js | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f371272a57..119f895af3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - `core`: Added `sendEvent`, in PR [#1286](https://github.com/Microsoft/BotFramework-WebChat/pull/1286) - `core`: Added `CONNECT_FULFILLING` action to workaround `redux-saga` [design decision](https://github.com/redux-saga/redux-saga/issues/1651), in PR [#1286](https://github.com/Microsoft/BotFramework-WebChat/pull/1286) - Added missing Spanish (es-ES) locale by [@schgressive](https://github.com/schgressive) in PR [#1615](https://github.com/Microsoft/BotFramework-WebChat/pull/1615) +- Fix [#1602](https://github.com/Microsoft/BotFramework-WebChat/issues/1602). Fix suggested actions regression of buttons, by [@corinagum](https://github.com/corinagum) in PR [#1616](https://github.com/Microsoft/BotFramework-WebChat/pull/1616) ### Changed - Moved `botAvatarImage` and `userAvatarImage` to `styleOptions.botAvatarImage` and `styleOptions.userAvatarImage` respectively, in PR [#1486](https://github.com/Microsoft/BotFramework-WebChat/pull/1486) diff --git a/packages/component/src/SendBox/SuggestedActions.js b/packages/component/src/SendBox/SuggestedActions.js index ce7fd3212b..0bb4ecde40 100644 --- a/packages/component/src/SendBox/SuggestedActions.js +++ b/packages/component/src/SendBox/SuggestedActions.js @@ -48,8 +48,11 @@ export default connectSuggestedActions( buttonText={ type === 'messageBack' ? title || displayText - : - title || (typeof value !== 'string') ? JSON.stringify(value) : value + : title ? + title + : (typeof value === 'string') ? + value + : JSON.stringify(value) } displayText={ displayText } key={ index } From a81bdd09db42135344d82e16256ed25752d10a67 Mon Sep 17 00:00:00 2001 From: Corina Date: Fri, 18 Jan 2019 15:31:31 -0800 Subject: [PATCH 3/5] PR fixes, factor out renderer into function --- __tests__/suggestedActions.js | 148 +++++++++--------- .../component/src/SendBox/SuggestedActions.js | 20 ++- 2 files changed, 87 insertions(+), 81 deletions(-) diff --git a/__tests__/suggestedActions.js b/__tests__/suggestedActions.js index cec16f5e01..2a331b9b89 100644 --- a/__tests__/suggestedActions.js +++ b/__tests__/suggestedActions.js @@ -9,129 +9,129 @@ function sleep(ms = 1000) { // https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/index_exports_WebDriver.html describe('suggested-actions command', async () => { - test('should show correctly formatted buttons when suggested actions are displayed', async() => { - const { driver } = await setupWebDriver(); + test('should show correctly formatted buttons when suggested actions are displayed', async() => { + const { driver } = await setupWebDriver(); - await sleep(2000); + await sleep(2000); - const input = await driver.findElement(By.tagName('input[type="text"]')); + const input = await driver.findElement(By.tagName('input[type="text"]')); - await input.sendKeys('suggested-actions', Key.RETURN); - await sleep(2000); + await input.sendKeys('suggested-actions', Key.RETURN); + await sleep(2000); - const base64PNG = await driver.takeScreenshot(); + const base64PNG = await driver.takeScreenshot(); - expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); - }, 60000); + expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); + }, 60000); - test('should show response from bot and no text from user on imback', async () => { - const { driver } = await setupWebDriver(); + test('should show response from bot and no text from user on imback', async () => { + const { driver } = await setupWebDriver(); - await sleep(2000); + await sleep(2000); - const input = await driver.findElement(By.tagName('input[type="text"]')); + const input = await driver.findElement(By.tagName('input[type="text"]')); - await input.sendKeys('suggested-actions', Key.RETURN); - await sleep(2000); + await input.sendKeys('suggested-actions', Key.RETURN); + await sleep(2000); - const buttons = await driver.findElements(By.tagName('button')); + const buttons = await driver.findElements(By.tagName('button')); - const imBackButton = buttons[1]; + const imBackButton = buttons[1]; - await imBackButton.click(); - await sleep(2000); + await imBackButton.click(); + await sleep(2000); - const base64PNG = await driver.takeScreenshot(); + const base64PNG = await driver.takeScreenshot(); - expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); - }, 60000); + expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); + }, 60000); - test('should show response from bot and no text from user on postback', async () => { - const { driver } = await setupWebDriver(); + test('should show response from bot and no text from user on postback', async () => { + const { driver } = await setupWebDriver(); - await sleep(2000); + await sleep(2000); - const input = await driver.findElement(By.tagName('input[type="text"]')); + const input = await driver.findElement(By.tagName('input[type="text"]')); - await input.sendKeys('suggested-actions', Key.RETURN); - await sleep(2000); + await input.sendKeys('suggested-actions', Key.RETURN); + await sleep(2000); - const buttons = await driver.findElements(By.tagName('button')); + const buttons = await driver.findElements(By.tagName('button')); - const postBackStringButton = buttons[2]; + const postBackStringButton = buttons[2]; - await postBackStringButton.click(); - await sleep(2000); + await postBackStringButton.click(); + await sleep(2000); - const base64PNG = await driver.takeScreenshot(); + const base64PNG = await driver.takeScreenshot(); - expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); - }, 60000); + expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); + }, 60000); - test('should show response from bot and text from user on postback', async () => { - const { driver } = await setupWebDriver(); + test('should show response from bot and text from user on postback', async () => { + const { driver } = await setupWebDriver(); - await sleep(2000); + await sleep(2000); - const input = await driver.findElement(By.tagName('input[type="text"]')); + const input = await driver.findElement(By.tagName('input[type="text"]')); - await input.sendKeys('suggested-actions', Key.RETURN); - await sleep(2000); + await input.sendKeys('suggested-actions', Key.RETURN); + await sleep(2000); - const buttons = await driver.findElements(By.tagName('button')); + const buttons = await driver.findElements(By.tagName('button')); - const postBackStringButton = buttons[3]; + const postBackStringButton = buttons[3]; - await postBackStringButton.click(); - await sleep(2000); + await postBackStringButton.click(); + await sleep(2000); - const base64PNG = await driver.takeScreenshot(); + const base64PNG = await driver.takeScreenshot(); - expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); - }, 60000); + expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); + }, 60000); - test('should show response from bot and no text from user on messageback', async () => { - const { driver } = await setupWebDriver(); + test('should show response from bot and no text from user on messageback', async () => { + const { driver } = await setupWebDriver(); - await sleep(2000); + await sleep(2000); - const input = await driver.findElement(By.tagName('input[type="text"]')); + const input = await driver.findElement(By.tagName('input[type="text"]')); - await input.sendKeys('suggested-actions', Key.RETURN); - await sleep(2000); + await input.sendKeys('suggested-actions', Key.RETURN); + await sleep(2000); - const buttons = await driver.findElements(By.tagName('button')); + const buttons = await driver.findElements(By.tagName('button')); - const postBackStringButton = buttons[4]; + const postBackStringButton = buttons[4]; - await postBackStringButton.click(); - await sleep(2000); + await postBackStringButton.click(); + await sleep(2000); - const base64PNG = await driver.takeScreenshot(); + const base64PNG = await driver.takeScreenshot(); - expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); - }, 60000); + expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); + }, 60000); - test('should show response from bot and text from user on messageback', async () => { - const { driver } = await setupWebDriver(); + test('should show response from bot and text from user on messageback', async () => { + const { driver } = await setupWebDriver(); - await sleep(2000); + await sleep(2000); - const input = await driver.findElement(By.tagName('input[type="text"]')); + const input = await driver.findElement(By.tagName('input[type="text"]')); - await input.sendKeys('suggested-actions', Key.RETURN); - await sleep(2000); + await input.sendKeys('suggested-actions', Key.RETURN); + await sleep(2000); - const buttons = await driver.findElements(By.tagName('button')); + const buttons = await driver.findElements(By.tagName('button')); - const postBackStringButton = buttons[4]; + const postBackStringButton = buttons[4]; - await postBackStringButton.click(); - await sleep(2000); + await postBackStringButton.click(); + await sleep(2000); - const base64PNG = await driver.takeScreenshot(); + const base64PNG = await driver.takeScreenshot(); - expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); - }, 60000); + expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions); + }, 60000); }); diff --git a/packages/component/src/SendBox/SuggestedActions.js b/packages/component/src/SendBox/SuggestedActions.js index 0bb4ecde40..9c0d943550 100644 --- a/packages/component/src/SendBox/SuggestedActions.js +++ b/packages/component/src/SendBox/SuggestedActions.js @@ -5,6 +5,18 @@ import React from 'react'; import connectToWebChat from '../connectToWebChat'; import SuggestedAction from './SuggestedAction'; +function renderSuggestedAction ({title, type, value}) { + if(type === 'messageBack') { + return title || displayText + } else if (title) { + return title; + } else if (typeof value === 'string') { + return value; + } else { + return JSON.stringify(value); + } +} + const connectSuggestedActions = (...selectors) => connectToWebChat( ({ language, @@ -46,13 +58,7 @@ export default connectSuggestedActions( ) => Date: Tue, 22 Jan 2019 09:44:46 -0800 Subject: [PATCH 4/5] PR fixes --- packages/component/src/SendBox/SuggestedActions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/component/src/SendBox/SuggestedActions.js b/packages/component/src/SendBox/SuggestedActions.js index 9c0d943550..04a38e9199 100644 --- a/packages/component/src/SendBox/SuggestedActions.js +++ b/packages/component/src/SendBox/SuggestedActions.js @@ -5,8 +5,8 @@ import React from 'react'; import connectToWebChat from '../connectToWebChat'; import SuggestedAction from './SuggestedAction'; -function renderSuggestedAction ({title, type, value}) { - if(type === 'messageBack') { +function suggestedActionText ({displayText, title, type, value}) { + if (type === 'messageBack') { return title || displayText } else if (title) { return title; @@ -58,7 +58,7 @@ export default connectSuggestedActions( ) => Date: Wed, 23 Jan 2019 11:42:12 -0800 Subject: [PATCH 5/5] Apply spacing suggestions from code review Co-Authored-By: corinagum --- packages/component/src/SendBox/SuggestedActions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/component/src/SendBox/SuggestedActions.js b/packages/component/src/SendBox/SuggestedActions.js index 04a38e9199..1647ac1394 100644 --- a/packages/component/src/SendBox/SuggestedActions.js +++ b/packages/component/src/SendBox/SuggestedActions.js @@ -5,7 +5,7 @@ import React from 'react'; import connectToWebChat from '../connectToWebChat'; import SuggestedAction from './SuggestedAction'; -function suggestedActionText ({displayText, title, type, value}) { +function suggestedActionText({ displayText, title, type, value }) { if (type === 'messageBack') { return title || displayText } else if (title) { @@ -58,7 +58,7 @@ export default connectSuggestedActions( ) =>