import { ReturnProcessIsNotCompleteError } from './return-process-is-not-complete.error';

describe('ReturnProcessIsNotCompleteError', () => {
  const processId = 123;
  const returnProcessId = 456;
  let error: ReturnProcessIsNotCompleteError;

  beforeEach(() => {
    error = new ReturnProcessIsNotCompleteError(processId, returnProcessId);
  });

  it('should instantiate the error with the given processIds', () => {
    expect(error.processId).toBe(processId);
    expect(error.returnProcessId).toBe(returnProcessId);
  });

  it('should create the correct error message', () => {
    const expectedMessage = `Return process with ID "456" is not complete for process ID "123".`;
    expect(error.message).toBe(expectedMessage);
  });

  it('should have the correct error code', () => {
    expect(error.code).toBe('RETURN_PROCESS_IS_NOT_COMPLETE');
  });

  it('should be an instance of Error', () => {
    expect(error).toBeInstanceOf(Error);
  });
});
