import { capitalize, capitalizeWords, uppercase } from './string';

describe('capitalize function', function () {
  it("transforms to upper case the word's 1st letter", function () {
    const test = 'lorem';
    const result = capitalize(test);

    expect(result).toBe('Lorem');
  });

  it('transforms return empty string if parameter is not a string', function () {
    const result = capitalize(1 as any);
    expect(result).toBe('');
  });
});

describe('capitalizeWords function', function () {
  it("transforms to upper case the word's 1st letter", function () {
    const test = 'lorem ipsum sit amet';
    const result = capitalizeWords(test);

    expect(result).toBe('Lorem Ipsum Sit Amet');
  });

  it('transforms return empty string if parameter is not a string', function () {
    const result = capitalizeWords(1 as any);
    expect(result).toBe('');
  });
});

describe('uppercase function', function () {
  it("transforms to upper case the word's 1st letter", function () {
    const test = 'lorem ipsum sit amet';
    const result = uppercase(test);

    expect(result).toBe('LOREM IPSUM SIT AMET');
  });

  it('transforms return empty string if parameter is not a string', function () {
    const result = uppercase(1 as any);
    expect(result).toBe('');
  });
});
