/**
 * @jest-environment ./src/xhrInterceptor/fetchProxy/__environments__/fetchEnvironment.ts
 */

import { describe, expect, it } from '@jest/globals';
import FetchInput from './FetchInput';

describe('FetchInput', () => {
  describe('getUrl', () => {
    const urlString = 'https://example.avm99963.com/';

    it('should return input when input is already a string', () => {
      const dummyInput = urlString;

      const sut = new FetchInput(dummyInput);
      const result = sut.getUrl();

      expect(result).toBe(urlString);
    });

    it('should return stringified url when input is a URL instance', () => {
      const dummyInput = new URL(urlString);

      const sut = new FetchInput(dummyInput);
      const result = sut.getUrl();

      expect(result).toBe(urlString);
    });

    it('should return url string when input is a Request instance', () => {
      const dummyInput = new Request(urlString);

      const sut = new FetchInput(dummyInput);
      const result = sut.getUrl();

      expect(result).toBe(urlString);
    });
  });
});
