-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathuseSendBoxValue.js
More file actions
26 lines (17 loc) · 978 Bytes
/
useSendBoxValue.js
File metadata and controls
26 lines (17 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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 get the send box text', async () => {
const { driver, pageObjects } = await setupWebDriver();
await driver.wait(uiConnected(), timeouts.directLine);
await pageObjects.typeInSendBox('Hello, World!');
await expect(pageObjects.runHook('useSendBoxValue', [], result => result[0])).resolves.toBe('Hello, World!');
});
test('setter should set the send box text', async () => {
const { driver, pageObjects } = await setupWebDriver();
await driver.wait(uiConnected(), timeouts.directLine);
await pageObjects.runHook('useSendBoxValue', [], result => result[1]('Hello, World!'));
await expect(pageObjects.getSendBoxText()).resolves.toBe('Hello, World!');
});