forked from akveo/nebular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflip-card.e2e-spec.ts
30 lines (24 loc) · 997 Bytes
/
flip-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
/**
* @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 { cardSizes as sizes } from './component-shared';
const cards = sizes.map((size, i) => ({ size, i }));
describe('nb-flip-card', () => {
beforeEach((done) => {
browser.get('#/card/card-test.component').then(() => done());
});
cards.forEach(c => {
describe(`${c.size.sizeKey} flip card`, () => {
function shouldShowFrontCard () {
const flipCard = element.all(by.tagName('nb-flip-card')).get(c.i);
const frontCard = flipCard.all(by.tagName('.front-container')).first();
expect(flipCard.getAttribute('class')).not.toContain('flipped', `flip card shouldn't be flipped`)
expect(frontCard.isDisplayed()).toBe(true, 'front card should be visible');
}
it(`should show front card`, shouldShowFrontCard);
});
});
});