-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathchat.e2e-spec.ts
56 lines (44 loc) · 1.34 KB
/
chat.e2e-spec.ts
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import { browser, element, by } from 'protractor';
import { colors, chatSizes as sizes } from './component-shared';
import { waitFor } from './e2e-helper';
let chats: any[] = [];
function prepareChats() {
const result: any[] = [];
let elementNumber: number = 1;
for (const { colorKey, color } of colors) {
for (const { sizeKey, height } of sizes) {
result.push({
size: sizeKey,
height: height,
colorKey,
color,
elementNumber,
});
elementNumber++;
}
}
return result;
}
describe('nb-chat', () => {
chats = prepareChats();
beforeAll((done) => {
browser.get('#/chat/chat-test.component').then(() => done());
});
chats.forEach(c => {
it(`should display ${c.colorKey} chat with ${c.size} size`, () => {
waitFor(`nb-chat:nth-child(${c.elementNumber})`);
element(by.css(`nb-chat:nth-child(${c.elementNumber})`)).getCssValue('height').then(height => {
expect(height).toEqual(c.height);
});
element(by.css(`nb-chat:nth-child(${c.elementNumber}) .header`))
.getCssValue('background-color').then(bgColor => {
expect(bgColor).toEqual(c.color);
});
});
});
});