@furystack/shades-common-components
Version:
Common UI components for FuryStack Shades
22 lines • 918 B
JavaScript
import { createInjector } from '@furystack/inject';
import { usingAsync } from '@furystack/utils';
import { describe, expect, it } from 'vitest';
import { NotyService } from './noty-service.js';
describe('NotyService', () => {
it('Should add and removea noty', async () => {
await usingAsync(createInjector(), async (injector) => {
const notyService = injector.get(NotyService);
expect(notyService.getNotyList()).toEqual([]);
const exampleNoty = {
type: 'info',
title: 'Test',
body: 'Test',
};
notyService.emit('onNotyAdded', exampleNoty);
expect(notyService.getNotyList()).toEqual([exampleNoty]);
notyService.emit('onNotyRemoved', exampleNoty);
expect(notyService.getNotyList()).toEqual([]);
});
});
});
//# sourceMappingURL=noty-service.spec.js.map