ohayolibs
Version:
Ohayo is a set of essential modules for ohayojp.
21 lines (17 loc) • 578 B
text/typescript
import { TestBed } from '@angular/core/testing';
import { OhayoChartConfig } from './chart/chart.type';
import { OhayoConfigService } from './config.service';
describe('util: config', () => {
let srv: OhayoConfigService;
beforeEach(() => {
TestBed.configureTestingModule({
providers: [OhayoConfigService],
});
srv = TestBed.inject(OhayoConfigService);
});
it('#set', () => {
expect(srv.get('chart')?.theme).toBeUndefined();
srv.set('chart', { theme: 'dark' } as OhayoChartConfig);
expect(srv.get('chart')?.theme).toBe('dark');
});
});