import { TestBed } from '@angular/core/testing';

import { UserService } from './user.service';
import { Router } from '@angular/router';

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

  const routerSpy = {
    navigate: jest.fn(),
    navigateByUrl: jest.fn(),
  };

  beforeEach(() => {
    TestBed.configureTestingModule({
      providers: [
        { provide: Router, useValue: routerSpy }, // <<— spy: neutralise la navigation
      ],
      imports: [],
    });
    service = TestBed.inject(UserService);
  });

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