// =============================================================================
// =ALESKI TEST - MAP-FIND-KEY
// =============================================================================

@import "aleksi/maps/map-find-key";

@include test-module('The map-find-key function')
{
  @include test('should return the key under which the given value is stored in a map')
  {
    @include assert-equal( map-find-key($str-map, 'salut'), 'fr' );
    @include assert-equal( map-find-key($str-map, 'hello'), 'en' );
  }

  @include test('should return the first key found when the value is stored multiple times in the map')
  {
    @include assert-equal( map-find-key($mix-map-types, 'number'), 'int' );
    @include assert-unequal( map-find-key($mix-map-types, 'number'), 'percentage' );
    @include assert-unequal( map-find-key($mix-map-types, 'number'), 'em' );
  }

  // @include xtest('should throw an error when passed wrong arguments')
  // {
  //   @include assert-equal( map-find-keys($num-list, $int), null );
  // }

    @include test('should be aliased as map-find')
  {
    @include assert-equal( map-find($mix-map-types, 'number'),  map-find-key($mix-map-types, 'number') );
  }
}
