-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathuseAdaptiveCardsHostConfig.js
More file actions
39 lines (29 loc) · 1.24 KB
/
useAdaptiveCardsHostConfig.js
File metadata and controls
39 lines (29 loc) · 1.24 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
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 Adaptive Cards host config set in props', async () => {
const { pageObjects } = await setupWebDriver({
props: {
adaptiveCardsHostConfig: {
supportsInteractivity: false
}
}
});
const [adaptiveCardsHostConfig] = await pageObjects.runHook('useAdaptiveCardsHostConfig');
expect(adaptiveCardsHostConfig).toMatchInlineSnapshot(`
{
"supportsInteractivity": false,
}
`);
});
test('getter should return default Adaptive Cards host config if not set in props', async () => {
const { pageObjects } = await setupWebDriver();
const [adaptiveCardsHostConfig] = await pageObjects.runHook('useAdaptiveCardsHostConfig');
expect(adaptiveCardsHostConfig.supportsInteractivity).toMatchInlineSnapshot(`true`);
});
test('setter should be undefined', async () => {
const { pageObjects } = await setupWebDriver();
const [_, setAdaptiveCardsHostConfig] = await pageObjects.runHook('useAdaptiveCardsHostConfig');
expect(setAdaptiveCardsHostConfig).toBeUndefined();
});