/*
 * Copyright (C) 2021 Robert Bosch GmbH Copyright (C) 2021 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
 */
import { TestBed } from '@angular/core/testing';
import { NotificationBannerService } from './notification-banner.service';
import { NotificationTypes } from './notification.models';

describe('NotificationBannerService', () => {
  let service: NotificationBannerService;

  beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [],
    });

    service = TestBed.inject(NotificationBannerService);
  });

  it('should be created', () => {
    expect(service).toBeTruthy();
  });

  it('should show emit show banner message', (done) => {
    const buttons = [{ text: 'link', link: 'http://www.bosch.com' }];
    service.showBannerMessage.subscribe((message) => {
      expect(message.text).toEqual('test');
      done();
    });
    service.showBanner('test', NotificationTypes.Success, buttons, true);
  });

  it('should show emit hide banner message', (done) => {
    service.hideBannerMessage.subscribe((bannerId) => {
      expect(bannerId).toEqual('test');
      done();
    });
    service.hideBanner('test');
  });
});
