-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathbootstrap-button.component.cy-spec.ts
40 lines (37 loc) · 1.11 KB
/
bootstrap-button.component.cy-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
import { initEnv, mount, setConfig } from 'cypress-angular-unit-test';
import { BootstrapButtonComponent } from './bootstrap-button.component';
describe('BootstrapButtonComponent', () => {
describe('setConfig function', () => {
beforeEach(() => {
setConfig({
stylesheet:
'https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css',
});
initEnv(BootstrapButtonComponent);
});
it('should create', () => {
mount(BootstrapButtonComponent);
// Should have BootStrap color style
cy.get('button').should(
'have.css',
'background-color',
'rgb(0, 123, 255)',
);
});
});
describe('setConfig in initEnv', () => {
it('should create', () => {
initEnv(BootstrapButtonComponent, {
stylesheet:
'https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css',
});
mount(BootstrapButtonComponent);
// Should have BootStrap color style
cy.get('button').should(
'have.css',
'background-color',
'rgb(0, 123, 255)',
);
});
});
});