Skip to content

Commit c4cee6b

Browse files
committed
Upgrade tests
1 parent e001684 commit c4cee6b

21 files changed

Lines changed: 460 additions & 75 deletions

__tests__/bubbleNub.js

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -41,81 +41,6 @@ describe('bubble nub', () => {
4141
};
4242
});
4343

44-
describe('with avatar initials', () => {
45-
beforeEach(() => {
46-
props = {
47-
...props,
48-
styleOptions: {
49-
...props.styleOptions,
50-
botAvatarInitials: 'WC',
51-
userAvatarInitials: 'WW'
52-
}
53-
};
54-
});
55-
56-
test('and carousel with a message should have nub on message only', async () => {
57-
const { driver, pageObjects } = await setupWebDriver({ props, zoom: 3 });
58-
59-
await sendMessageAndMatchSnapshot(driver, pageObjects, 'layout carousel');
60-
});
61-
62-
test('and carousel without a message should not have nubs', async () => {
63-
const { driver, pageObjects } = await setupWebDriver({ props, zoom: 3 });
64-
65-
await sendMessageAndMatchSnapshot(driver, pageObjects, 'carousel');
66-
});
67-
68-
test('and stacked without a message should not have nubs', async () => {
69-
const { driver, pageObjects } = await setupWebDriver({ props, zoom: 3 });
70-
71-
await sendMessageAndMatchSnapshot(driver, pageObjects, 'layout single');
72-
});
73-
74-
test('and a single message should have nub', async () => {
75-
const { driver, pageObjects } = await setupWebDriver({ props, zoom: 3 });
76-
77-
await sendMessageAndMatchSnapshot(driver, pageObjects, 'Hello, World!');
78-
});
79-
80-
test('and carousel with a single attachment should have nub on message only', async () => {
81-
const { driver, pageObjects } = await setupWebDriver({ props, zoom: 3 });
82-
83-
await sendMessageAndMatchSnapshot(driver, pageObjects, 'layout single carousel');
84-
});
85-
});
86-
87-
describe('without avatar initials', () => {
88-
test('and carousel with a message should have nub on message only and indented', async () => {
89-
const { driver, pageObjects } = await setupWebDriver({ props, zoom: 3 });
90-
91-
await sendMessageAndMatchSnapshot(driver, pageObjects, 'layout carousel');
92-
});
93-
94-
test('and carousel without a message should not have nubs and indented', async () => {
95-
const { driver, pageObjects } = await setupWebDriver({ props, zoom: 3 });
96-
97-
await sendMessageAndMatchSnapshot(driver, pageObjects, 'carousel');
98-
});
99-
100-
test('and stacked without a message should not have nubs and indented', async () => {
101-
const { driver, pageObjects } = await setupWebDriver({ props, zoom: 3 });
102-
103-
await sendMessageAndMatchSnapshot(driver, pageObjects, 'layout single');
104-
});
105-
106-
test('and a single message should have nub and indented', async () => {
107-
const { driver, pageObjects } = await setupWebDriver({ props, zoom: 3 });
108-
109-
await sendMessageAndMatchSnapshot(driver, pageObjects, 'Hello, World!');
110-
});
111-
112-
test('and carousel with a single attachment should have nub on message only', async () => {
113-
const { driver, pageObjects } = await setupWebDriver({ props, zoom: 3 });
114-
115-
await sendMessageAndMatchSnapshot(driver, pageObjects, 'layout single carousel');
116-
});
117-
});
118-
11944
describe('at corner with offset', () => {
12045
test('of 5px should have corner radius of 5px', async () => {
12146
const { driver, pageObjects } = await setupWebDriver({
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!doctype html>
2+
<html lang="en-US">
3+
<head>
4+
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
5+
<script crossorigin="anonymous" src="/test-harness.js"></script>
6+
<script crossorigin="anonymous" src="/test-page-object.js"></script>
7+
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
8+
</head>
9+
<body>
10+
<main id="webchat"></main>
11+
<script>
12+
run(async function () {
13+
await host.windowSize(1080, 1920);
14+
15+
document.getElementById('webchat').style.zoom = 3;
16+
17+
WebChat.renderWebChat(
18+
{
19+
directLine: WebChat.createDirectLine({ token: await testHelpers.token.fetchDirectLineToken() }),
20+
store: testHelpers.createStore(),
21+
styleOptions: {
22+
botAvatarInitials: 'WC',
23+
bubbleBorderColor: 'red',
24+
bubbleBorderRadius: 10,
25+
bubbleBorderWidth: 2,
26+
bubbleFromUserBorderColor: 'green',
27+
bubbleFromUserBorderRadius: 10,
28+
bubbleFromUserNubOffset: 0,
29+
bubbleFromUserNubSize: 10,
30+
bubbleFromUserBorderWidth: 2,
31+
bubbleNubOffset: 0,
32+
bubbleNubSize: 10,
33+
userAvatarInitials: 'WW'
34+
}
35+
},
36+
document.getElementById('webchat')
37+
);
38+
39+
await pageConditions.uiConnected();
40+
41+
await pageObjects.sendMessageViaSendBox('carousel');
42+
43+
await host.snapshot('local');
44+
});
45+
</script>
46+
</body>
47+
</html>

__tests__/__image_snapshots__/chrome-docker/bubble-nub-js-bubble-nub-with-avatar-initials-and-carousel-without-a-message-should-not-have-nubs-1-snap.png renamed to __tests__/html2/bubble/nub/withAvatars/carousel.html.snap-1.png

File renamed without changes.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!doctype html>
2+
<html lang="en-US">
3+
<head>
4+
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
5+
<script crossorigin="anonymous" src="/test-harness.js"></script>
6+
<script crossorigin="anonymous" src="/test-page-object.js"></script>
7+
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
8+
</head>
9+
<body>
10+
<main id="webchat"></main>
11+
<script>
12+
run(async function () {
13+
await host.windowSize(1080, 1920);
14+
15+
document.getElementById('webchat').style.zoom = 3;
16+
17+
WebChat.renderWebChat(
18+
{
19+
directLine: WebChat.createDirectLine({ token: await testHelpers.token.fetchDirectLineToken() }),
20+
store: testHelpers.createStore(),
21+
styleOptions: {
22+
botAvatarInitials: 'WC',
23+
bubbleBorderColor: 'red',
24+
bubbleBorderRadius: 10,
25+
bubbleBorderWidth: 2,
26+
bubbleFromUserBorderColor: 'green',
27+
bubbleFromUserBorderRadius: 10,
28+
bubbleFromUserNubOffset: 0,
29+
bubbleFromUserNubSize: 10,
30+
bubbleFromUserBorderWidth: 2,
31+
bubbleNubOffset: 0,
32+
bubbleNubSize: 10,
33+
userAvatarInitials: 'WW'
34+
}
35+
},
36+
document.getElementById('webchat')
37+
);
38+
39+
await pageConditions.uiConnected();
40+
41+
await pageObjects.sendMessageViaSendBox('Hello, World!');
42+
43+
await host.snapshot('local');
44+
});
45+
</script>
46+
</body>
47+
</html>

__tests__/__image_snapshots__/chrome-docker/bubble-nub-js-bubble-nub-with-avatar-initials-and-a-single-message-should-have-nub-1-snap.png renamed to __tests__/html2/bubble/nub/withAvatars/helloWorld.html.snap-1.png

File renamed without changes.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!doctype html>
2+
<html lang="en-US">
3+
<head>
4+
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
5+
<script crossorigin="anonymous" src="/test-harness.js"></script>
6+
<script crossorigin="anonymous" src="/test-page-object.js"></script>
7+
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
8+
</head>
9+
<body>
10+
<main id="webchat"></main>
11+
<script>
12+
run(async function () {
13+
await host.windowSize(1080, 1920);
14+
15+
document.getElementById('webchat').style.zoom = 3;
16+
17+
WebChat.renderWebChat(
18+
{
19+
directLine: WebChat.createDirectLine({ token: await testHelpers.token.fetchDirectLineToken() }),
20+
store: testHelpers.createStore(),
21+
styleOptions: {
22+
botAvatarInitials: 'WC',
23+
bubbleBorderColor: 'red',
24+
bubbleBorderRadius: 10,
25+
bubbleBorderWidth: 2,
26+
bubbleFromUserBorderColor: 'green',
27+
bubbleFromUserBorderRadius: 10,
28+
bubbleFromUserNubOffset: 0,
29+
bubbleFromUserNubSize: 10,
30+
bubbleFromUserBorderWidth: 2,
31+
bubbleNubOffset: 0,
32+
bubbleNubSize: 10,
33+
userAvatarInitials: 'WW'
34+
}
35+
},
36+
document.getElementById('webchat')
37+
);
38+
39+
await pageConditions.uiConnected();
40+
41+
await pageObjects.sendMessageViaSendBox('layout carousel');
42+
43+
await host.snapshot('local');
44+
});
45+
</script>
46+
</body>
47+
</html>

__tests__/__image_snapshots__/chrome-docker/bubble-nub-js-bubble-nub-with-avatar-initials-and-carousel-with-a-message-should-have-nub-on-message-only-1-snap.png renamed to __tests__/html2/bubble/nub/withAvatars/layoutCarousel.html.snap-1.png

File renamed without changes.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!doctype html>
2+
<html lang="en-US">
3+
<head>
4+
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
5+
<script crossorigin="anonymous" src="/test-harness.js"></script>
6+
<script crossorigin="anonymous" src="/test-page-object.js"></script>
7+
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
8+
</head>
9+
<body>
10+
<main id="webchat"></main>
11+
<script>
12+
run(async function () {
13+
await host.windowSize(1080, 1920);
14+
15+
document.getElementById('webchat').style.zoom = 3;
16+
17+
WebChat.renderWebChat(
18+
{
19+
directLine: WebChat.createDirectLine({ token: await testHelpers.token.fetchDirectLineToken() }),
20+
store: testHelpers.createStore(),
21+
styleOptions: {
22+
botAvatarInitials: 'WC',
23+
bubbleBorderColor: 'red',
24+
bubbleBorderRadius: 10,
25+
bubbleBorderWidth: 2,
26+
bubbleFromUserBorderColor: 'green',
27+
bubbleFromUserBorderRadius: 10,
28+
bubbleFromUserNubOffset: 0,
29+
bubbleFromUserNubSize: 10,
30+
bubbleFromUserBorderWidth: 2,
31+
bubbleNubOffset: 0,
32+
bubbleNubSize: 10,
33+
userAvatarInitials: 'WW'
34+
}
35+
},
36+
document.getElementById('webchat')
37+
);
38+
39+
await pageConditions.uiConnected();
40+
41+
await pageObjects.sendMessageViaSendBox('layout single');
42+
43+
await host.snapshot('local');
44+
});
45+
</script>
46+
</body>
47+
</html>

__tests__/__image_snapshots__/chrome-docker/bubble-nub-js-bubble-nub-with-avatar-initials-and-stacked-without-a-message-should-not-have-nubs-1-snap.png renamed to __tests__/html2/bubble/nub/withAvatars/layoutSingle.html.snap-1.png

File renamed without changes.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!doctype html>
2+
<html lang="en-US">
3+
<head>
4+
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
5+
<script crossorigin="anonymous" src="/test-harness.js"></script>
6+
<script crossorigin="anonymous" src="/test-page-object.js"></script>
7+
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
8+
</head>
9+
<body>
10+
<main id="webchat"></main>
11+
<script>
12+
run(async function () {
13+
await host.windowSize(1080, 1920);
14+
15+
document.getElementById('webchat').style.zoom = 3;
16+
17+
WebChat.renderWebChat(
18+
{
19+
directLine: WebChat.createDirectLine({ token: await testHelpers.token.fetchDirectLineToken() }),
20+
store: testHelpers.createStore(),
21+
styleOptions: {
22+
botAvatarInitials: 'WC',
23+
bubbleBorderColor: 'red',
24+
bubbleBorderRadius: 10,
25+
bubbleBorderWidth: 2,
26+
bubbleFromUserBorderColor: 'green',
27+
bubbleFromUserBorderRadius: 10,
28+
bubbleFromUserNubOffset: 0,
29+
bubbleFromUserNubSize: 10,
30+
bubbleFromUserBorderWidth: 2,
31+
bubbleNubOffset: 0,
32+
bubbleNubSize: 10,
33+
userAvatarInitials: 'WW'
34+
}
35+
},
36+
document.getElementById('webchat')
37+
);
38+
39+
await pageConditions.uiConnected();
40+
41+
await pageObjects.sendMessageViaSendBox('layout single carousel');
42+
43+
await host.snapshot('local');
44+
});
45+
</script>
46+
</body>
47+
</html>

0 commit comments

Comments
 (0)