import getColour from '@lendi-ui/commons/colours';

describe('getColour()', () => {
  // Note: these tests will have to be updated if the colour values change
  it('should return a hex colour string by default', () => {
    expect(getColour('primary', 500)).toEqual('#00C0A5');
  });

  it('semantic should return a hex colour string', () => {
    expect(getColour('interaction', 'main')).toEqual('#00C0A5');
  });

  it('semantic state should return a hex colour string', () => {
    expect(getColour('buttonFill', 'primary', { state: 'hover' })).toEqual('#32CCB7');
  });

  it('should return `undefined` when an invalid transparency is passed', () => {
    expect(getColour('primary', 5000)).toBeUndefined();
  });

  it('should return a domain string when passed theme', () => {
    expect(getColour('primary', 500, { theme: 'domain' })).toEqual('#0ea800');
  });

  it('should return `undefined` when an invalid domain colour is passed', () => {
    expect(getColour('primary', 75, { theme: 'domain' })).toBeUndefined();
  });
});
