'use strict';

describe('mdc-icon', function() {
  let MockIcon;
  let MockButton;
  const icon1 = 'home';

  beforeEach(angular.mock.module('mdc'));
  beforeEach(angular.mock.module('ngMockComponent'));

  beforeEach(inject(($componentGenerator) => {
    MockIcon = $componentGenerator('mdcIcon');
    MockButton = $componentGenerator('mdcButton');
  }));

  it('should have the `material-icons` class by default', () => {
    const elem = new MockIcon().$element;

    expect(elem.hasClass('material-icons')).to.be.true;
  });

  it('should set the font-size to whatever is given in size', () => {
    const component = new MockIcon({'ng-bind': icon1, 'size': 42});
    expect(component.$element[0].style.fontSize).to.equal('42px');
  });

  it('should add mdc-button__icon class if inside a button', () => {
    const button = new MockButton(undefined, undefined, false);
    const icon = new MockIcon(undefined, undefined, false);
    button.$element.append(icon.$element);

    button.compile(); // will compile icon

    expect(icon.$element.hasClass('mdc-button__icon')).to.be.true;
  });
});

@@ -62,26 +62,8 @@
 on;%0A
-  let MockButton;%0A
   co
@@ -82,16 +82,16 @@
 'home';%0A
+
 %0A  befor
@@ -278,59 +278,8 @@
 ');%0A
-    MockButton = $componentGenerator('mdcButton');%0A
   %7D)
@@ -592,16 +592,16 @@
 : 42%7D);%0A
+
     expe
@@ -668,363 +668,8 @@
  %7D);
-%0A%0A  it('should add mdc-button__icon class if inside a button', () =%3E %7B%0A    const button = new MockButton(undefined, undefined, false);%0A    const icon = new MockIcon(undefined, undefined, false);%0A    button.$element.append(icon.$element);%0A%0A    button.compile(); // will compile icon%0A%0A    expect(icon.$element.hasClass('mdc-button__icon')).to.be.true;%0A  %7D);
 %0A%7D);

remove test for button detection