-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathcard.e2e-spec.ts
49 lines (39 loc) · 1.13 KB
/
card.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
/**
* @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, cardSizes as sizes } from './component-shared';
import { waitFor } from './e2e-helper';
let cards: any[] = [];
function prepareCards() {
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-card', () => {
cards = prepareCards();
beforeAll((done) => {
browser.get('#/card/card-test.component').then(() => done());
});
cards.forEach(c => {
it(`should display ${c.colorKey} card with ${c.size} size`, () => {
waitFor(`nb-card:nth-child(${c.elementNumber})`);
expect(element(by.css(`nb-card:nth-child(${c.elementNumber}) > nb-card-header`))
.getText()).toEqual('Header');
});
});
});