// Color Utility Tests
// ===================


// Tint [function]
// ---------------
@include describe('Tint [function]') {
  @include it('Adjusts the tint of a color') {
    @include assert-equal(
      tint('primary', 25%),
      mix(#fff, color('primary'), 25%),
      'Returns a color mixed with white at a given weight.'
    );
  }
}


// Shade [function]
// ----------------
@include describe('Shade [function]') {
  @include it('Adjusts the shade of a color') {
    @include assert-equal(
      shade('primary', 25%),
      mix(#000, color('primary'), 25%),
      'Returns a color mixed with black at a given weight.'
    );
  }
}


// Get Function [function]
// -----------------------
@include describe('Get Function [function]') {
  $test: _ac-color-get-function('tint');
  $expect: 'tint';

  @if function-exists('get-function') {
    $expect: get-function('tint');

    @include it('Functions are returned without change') {
      @include assert-equal(
        _ac-color-get-function($expect),
        $expect
      );
    }
  }

  @include it('Returns a function or function-name') {
    @include assert-equal($test, $expect);
  }

  @include it('Returned function or name is callable') {
    @include assert-equal(
      call($test, 'blue', 100%),
      white
    );
  }
}
