import { TestBed } from '@angular/core/testing';
import { UserNotificationService } from './user-notification.service';

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

  beforeEach(() => {
    TestBed.configureTestingModule({});
    service = TestBed.inject(UserNotificationService);
  });

  it('stores the route on the notification when provided', () => {
    service.show('New order #1042', 'info', 4000, ['en', 'backoffice', 'orders', 'ord_1']);

    const [note] = service.notifications();
    expect(note.message).toBe('New order #1042');
    expect(note.route).toEqual(['en', 'backoffice', 'orders', 'ord_1']);
  });

  it('leaves route undefined when not provided', () => {
    service.show('Saved');

    const [note] = service.notifications();
    expect(note.route).toBeUndefined();
  });
});
