import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ReplaceAllPipe, HexToRgbPipe } from '@pipes'; import * as constants from '@assets/json-grouped-colors.json'; import { ColorTableComponent } from './color-table.component'; describe('ColorTableComponent', () => { let component: ColorTableComponent; let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ ColorTableComponent, HexToRgbPipe, ReplaceAllPipe, ], }) .compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(ColorTableComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('creates the component', () => { expect(component).toBeTruthy(); }); describe('ngOnInit()', () => { it('sets the available colors', () => { expect(component.colors).toEqual(constants.brandColors); }); }); });