Catalog alignment
[sdc.git] / catalog-ui / src / app / ng2 / pages / composition / graph / canvas-zone / zone-container.component.spec.ts
1 import {async, ComponentFixture} from '@angular/core/testing';
2 import {By} from '@angular/platform-browser';
3 import {ConfigureFn, configureTests} from '../../../../../../jest/test-config.helper';
4 import 'jest-dom/extend-expect';
5 import {ZoneInstanceType} from '../../../../../../app/models/graph/zones/zone-instance';
6 import {ZoneContainerComponent} from './zone-container.component';
7
8
9 describe('ZoneContainerComponent', () => {
10     let fixture: ComponentFixture<ZoneContainerComponent>;
11
12     beforeEach(
13         async(() => {
14             const configure: ConfigureFn = testBed => {
15                 testBed.configureTestingModule({
16                     declarations: [ZoneContainerComponent]
17                 });
18             };
19
20             configureTests(configure).then(testBed => {
21                 fixture = testBed.createComponent(ZoneContainerComponent);
22             });
23         })
24     );
25
26
27     it('should match current snapshot of palette element component', () => {
28         expect(fixture).toMatchSnapshot();
29     });
30
31     it('should have a group-zone class when the ZoneInstanceType is GROUP',
32         () => {
33             fixture.componentInstance.type = ZoneInstanceType.GROUP;
34             fixture.detectChanges();
35             const compiled = fixture.debugElement.query(By.css('.sdc-canvas-zone'));
36             expect(compiled.nativeElement).toHaveClass('group-zone');
37         });
38
39     it('should have a policy-zone class when the ZoneInstanceType is POLICY',
40         () => {
41             fixture.componentInstance.type = ZoneInstanceType.POLICY;
42             fixture.detectChanges();
43             const compiled = fixture.debugElement.query(By.css('.sdc-canvas-zone'));
44             expect(compiled.nativeElement).toHaveClass('policy-zone');
45         });
46 });