-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix-2620' of https://github.com/spyip/BotFramework-WebChat
- Loading branch information
Showing
23 changed files
with
339 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+37.4 KB
...ly-formatted-buttons-when-suggested-actions-are-displayed-as-stacked-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.4 KB
...-command-should-show-suggested-actions-with-larger-images-as-stacked-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { timeouts } from '../constants.json'; | ||
import uiConnected from '../setup/conditions/uiConnected'; | ||
|
||
// selenium-webdriver API doc: | ||
// https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/index_exports_WebDriver.html | ||
|
||
jest.setTimeout(timeouts.test); | ||
|
||
test('getter should return online', async () => { | ||
const { driver, pageObjects } = await setupWebDriver(); | ||
|
||
await driver.wait(uiConnected(), timeouts.directLine); | ||
|
||
const [connectivityStatus] = await pageObjects.runHook('useConnectivityStatus'); | ||
|
||
expect(connectivityStatus).toMatchInlineSnapshot(`"connected"`); | ||
}); | ||
|
||
test('setter should be falsy', async () => { | ||
const { pageObjects } = await setupWebDriver(); | ||
const [_, setConnectivityStatus] = await pageObjects.runHook('useConnectivityStatus'); | ||
|
||
expect(setConnectivityStatus).toBeFalsy(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { timeouts } from '../constants.json'; | ||
|
||
// selenium-webdriver API doc: | ||
// https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/index_exports_WebDriver.html | ||
|
||
jest.setTimeout(timeouts.test); | ||
|
||
test('getter should return group timestamp set in props', async () => { | ||
const { pageObjects } = await setupWebDriver({ | ||
props: { | ||
groupTimestamp: 1000 | ||
} | ||
}); | ||
|
||
const [groupTimestamp] = await pageObjects.runHook('useGroupTimestamp'); | ||
|
||
expect(groupTimestamp).toMatchInlineSnapshot(`1000`); | ||
}); | ||
|
||
test('getter should return default group timestamp if not set in props', async () => { | ||
const { pageObjects } = await setupWebDriver(); | ||
|
||
const [groupTimestamp] = await pageObjects.runHook('useGroupTimestamp'); | ||
|
||
expect(groupTimestamp).toMatchInlineSnapshot(`true`); | ||
}); | ||
|
||
test('getter should return false if group timestamp is disabled', async () => { | ||
const { pageObjects } = await setupWebDriver({ | ||
props: { groupTimestamp: false } | ||
}); | ||
|
||
const [groupTimestamp] = await pageObjects.runHook('useGroupTimestamp'); | ||
|
||
expect(groupTimestamp).toMatchInlineSnapshot(`false`); | ||
}); | ||
|
||
test('setter should be falsy', async () => { | ||
const { pageObjects } = await setupWebDriver(); | ||
const [_, setGroupTimestamp] = await pageObjects.runHook('useGroupTimestamp'); | ||
|
||
expect(setGroupTimestamp).toBeFalsy(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { timeouts } from '../constants.json'; | ||
|
||
// selenium-webdriver API doc: | ||
// https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/index_exports_WebDriver.html | ||
|
||
jest.setTimeout(timeouts.test); | ||
|
||
test('getter should return timeout for sending activity', async () => { | ||
const { pageObjects } = await setupWebDriver({ | ||
props: { | ||
sendTimeout: 1000 | ||
} | ||
}); | ||
|
||
const [timeoutForSend] = await pageObjects.runHook('useTimeoutForSend'); | ||
|
||
expect(timeoutForSend).toMatchInlineSnapshot(`1000`); | ||
}); | ||
|
||
test('getter should return default timeout for sending activity if not set in props', async () => { | ||
const { pageObjects } = await setupWebDriver(); | ||
|
||
const [timeoutForSend] = await pageObjects.runHook('useTimeoutForSend'); | ||
|
||
expect(timeoutForSend).toMatchInlineSnapshot(`20000`); | ||
}); | ||
|
||
test('setter should set the timeout for sending activity', async () => { | ||
const { pageObjects } = await setupWebDriver(); | ||
|
||
await pageObjects.runHook('useTimeoutForSend', [], result => result[1](1000)); | ||
|
||
const [timeoutForSend] = await pageObjects.runHook('useTimeoutForSend'); | ||
|
||
expect(timeoutForSend).toMatchInlineSnapshot(`1000`); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { timeouts } from '../constants.json'; | ||
|
||
// selenium-webdriver API doc: | ||
// https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/index_exports_WebDriver.html | ||
|
||
jest.setTimeout(timeouts.test); | ||
|
||
test('getter should return user ID set in props', async () => { | ||
const { pageObjects } = await setupWebDriver({ | ||
props: { | ||
userID: 'u-12345' | ||
} | ||
}); | ||
|
||
const [userID] = await pageObjects.runHook('useUserID'); | ||
|
||
expect(userID).toMatchInlineSnapshot(`"u-12345"`); | ||
}); | ||
|
||
test('getter should return empty string if not set in props', async () => { | ||
const { pageObjects } = await setupWebDriver(); | ||
|
||
const [userID] = await pageObjects.runHook('useUserID'); | ||
|
||
expect(userID).toMatchInlineSnapshot(`""`); | ||
}); | ||
|
||
test('setter should be falsy', async () => { | ||
const { pageObjects } = await setupWebDriver(); | ||
const [_, setUserID] = await pageObjects.runHook('useUserID'); | ||
|
||
expect(setUserID).toBeFalsy(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { timeouts } from '../constants.json'; | ||
|
||
// selenium-webdriver API doc: | ||
// https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/index_exports_WebDriver.html | ||
|
||
jest.setTimeout(timeouts.test); | ||
|
||
test('getter should return username set in props', async () => { | ||
const { pageObjects } = await setupWebDriver({ | ||
props: { | ||
username: 'u-12345' | ||
} | ||
}); | ||
|
||
const [username] = await pageObjects.runHook('useUsername'); | ||
|
||
expect(username).toMatchInlineSnapshot(`"u-12345"`); | ||
}); | ||
|
||
test('getter should return undefined if not set in props', async () => { | ||
const { pageObjects } = await setupWebDriver(); | ||
|
||
const [username] = await pageObjects.runHook('useUsername'); | ||
|
||
expect(username).toMatchInlineSnapshot(`"Happy Web Chat user"`); | ||
}); | ||
|
||
test('setter should be falsy', async () => { | ||
const { pageObjects } = await setupWebDriver(); | ||
const [_, setUsername] = await pageObjects.runHook('useUsername'); | ||
|
||
expect(setUsername).toBeFalsy(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { By, until } from 'selenium-webdriver'; | ||
|
||
export default function suggestedActionsShown() { | ||
return until.elementLocated(By.css('[role="form"] ul')); | ||
return until.elementLocated(By.css('[role="form"] > :not(.main) button')); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.