<commit_before>describe('ng-mfb', function() {

  var $compile,
      $rootScope;

  beforeEach(module('ng-mfb'));

  beforeEach(inject(function(_$compile_, _$rootScope_){
    $compile = _$compile_;
    $rootScope = _$rootScope_;
  }));

  /**
   * This directive uses transclusion so for testing purposes we have to
   * wrap the tested element in a wrapping div and then fetch its
   * contents. See: 
   * Testing Transclusion Directives @ https://docs.angularjs.org/guide/unit-testing
   *
   **/
  function compile( template ){
    var node = $compile('<div>' + template + '</div>')($rootScope);
    return node.contents();
  }

  it('should properly transclude the div element', function(){
    var tpl = '<div mfb-menu position="tr" effect="zoomin" label="hover here" active-icon="ion-edit" resting-icon="ion-plus-round">' +
              '  <a mfb-button icon="icon-name" label="label-text"></a>' +
              '</div>';

    var node = compile(tpl);
    $rootScope.$digest();

    expect(node.hasClass('mfb-component--tr')).toBeTruthy();
    expect(node.find('ul').hasClass('mfb-component__list')).toBeTruthy();      
  });


  describe('when passing an option to the position attribute', function(){

    var node;

    function generateTpl( pos ){
      var tpl = '<div mfb-menu position="' + pos +'"></div>';

      node = compile(tpl);
      $rootScope.$digest();      
    }<commit_msg>more tests<commit_after>describe('ng-mfb', function() {

  var $compile,
      $rootScope;

  beforeEach(module('ng-mfb'));

  beforeEach(inject(function(_$compile_, _$rootScope_){
    $compile = _$compile_;
    $rootScope = _$rootScope_;
  }));

  /**
   * This directive uses transclusion so for testing purposes we have to
   * wrap the tested element in a wrapping div and then fetch its
   * contents. See: 
   * Testing Transclusion Directives @ https://docs.angularjs.org/guide/unit-testing
   *
   **/
  function compile( template ){
    var node = $compile('<div>' + template + '</div>')($rootScope);
    return node.contents();
  }

  describe('the directive', function(){

    it('should properly transclude the div element', function(){
      var tpl = '<div mfb-menu position="tr" effect="zoomin" label="hover here" active-icon="ion-edit" resting-icon="ion-plus-round">' +
                '  <a mfb-button icon="icon-name" label="label-text"></a>' +
                '</div>';

      var node = compile(tpl);
      $rootScope.$digest();

      expect(node.hasClass('mfb-component--tr')).toBeTruthy();
      expect(node.find('ul').hasClass('mfb-component__list')).toBeTruthy();      
    });

    it('should be possibile to be instantiated as an attribute', function(){
        var tpl = '<div mfb-menu></div>',
            node = compile(tpl);
        $rootScope.$digest();   

        expect(node.parent().find('ul')).toBeTruthy();
    });

    it('should be possibile to be instantiated as an element', function(){
        var tpl = '<mfb-menu></mfb-menu>',
            node = compile(tpl);
        $rootScope.$digest();   

        expect(node.parent().find('mfb-menu')).toBeTruthy();
    });

  });


  describe('when passing an option to the position attribute', function(){

    var node;

    function generateTpl( pos ){
      var tpl = '<div mfb-menu position="' + pos +'"></div>';

      node = compile(tpl);
      $rootScope.$digest();      
    }
{'fraction_non_alphanumeric': 0.16725978647686832, 'fraction_numerical': 0.0, 'mean_word_length': 2.9822904368358913, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6769103', 'n_tokens_mistral': 1050, 'n_tokens_neox': 1011, 'n_words': 245}