<commit_before>import { TestBed, ComponentFixture } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { Toolbar } from './toolbar';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { Component } from '@angular/core';
import { ButtonModule } from '../button/button';

@Component({
  template: `<p-toolbar>
  <div class="ui-toolbar-group-left">
      <button  type="button" label="New" icon="pi pi-plus"></button>
      <button  type="button" label="Upload" icon="pi pi-upload" class="ui-button-success"></button>
  </div>
  
  <div class="ui-toolbar-group-right">
      <button  type="button" icon="pi pi-search"></button>
      <button  type="button" icon="pi pi-calendar" class="ui-button-success"></button>
      <button  type="button" icon="pi pi-times" class="ui-button-danger"></button>
  </div>
</p-toolbar>`
})
class TestToolbarComponent {
}

describe('Toolbar', () => {
  
    let toolbar: Toolbar;
    let fixture: ComponentFixture<TestToolbarComponent>;
    
    beforeEach(() => {
      TestBed.configureTestingModule({
        imports: [
          NoopAnimationsModule,
          ButtonModule
        ],
        declarations: [
          Toolbar,
          TestToolbarComponent,
        ]
      });
      
      fixture = TestBed.createComponent(TestToolbarComponent);
      toolbar = fixture.debugElement.children[0].componentInstance;
    });

    it('should display by default', () => {
      fixture.detectChanges();

      const toolbarEl = fixture.debugElement.query(By.css('p-toolbar'));
      expect(toolbarEl.nativeElement).toBeTruthy();
      expect(toolbarEl.nativeElement.children[0].children.length).toEqual(2);
    });

    it('should change style and styleClass', () => {
      toolbar.style = {'height' : '300px'};
      toolbar.styleClass = "Primeng ROCKS!";
      fixture.detectChanges();

      const toolbarEl = fixture.debugElement.query(By.css('div')).nativeElement;
      expect(toolbarEl.className).toContain("Primeng ROCKS!");
      expect(toolbarEl.style.height).toEqual("300px");
    });

    it('should show ng-content', () => {
      fixture.detectChanges();

      const contentEl = fixture.debugElement.query(By.css('.ui-toolbar-group-left')).nativeElement;
      expect(contentEl).toBeTruthy();
    });

});<commit_msg>#9116 - Unit tests should be pass for Toolbar<commit_after>import { TestBed, ComponentFixture } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { Toolbar } from './toolbar';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { Component } from '@angular/core';
import { ButtonModule } from '../button/button';

@Component({
	template: `<p-toolbar>
  <div class="p-toolbar-group-left">
      <button  type="button" label="New" icon="pi pi-plus"></button>
      <button  type="button" label="Upload" icon="pi pi-upload" class="p-button-success"></button>
  </div>
  
  <div class="p-toolbar-group-right">
      <button  type="button" icon="pi pi-search"></button>
      <button  type="button" icon="pi pi-calendar" class="p-button-success"></button>
      <button  type="button" icon="pi pi-times" class="p-button-danger"></button>
  </div>
</p-toolbar>`
})
class TestToolbarComponent {
}

describe('Toolbar', () => {

	let toolbar: Toolbar;
	let fixture: ComponentFixture<TestToolbarComponent>;

	beforeEach(() => {
		TestBed.configureTestingModule({
			imports: [
				NoopAnimationsModule,
				ButtonModule
			],
			declarations: [
				Toolbar,
				TestToolbarComponent,
			]
		});

		fixture = TestBed.createComponent(TestToolbarComponent);
		toolbar = fixture.debugElement.children[0].componentInstance;
	});

	it('should display by default', () => {
		fixture.detectChanges();

		const toolbarEl = fixture.debugElement.query(By.css('p-toolbar'));
		expect(toolbarEl.nativeElement).toBeTruthy();
		expect(toolbarEl.nativeElement.children[0].children.length).toEqual(2);
	});

	it('should change style and styleClass', () => {
		toolbar.style = { 'height': '300px' };
		toolbar.styleClass = "Primeng ROCKS!";
		fixture.detectChanges();

		const toolbarEl = fixture.debugElement.query(By.css('div')).nativeElement;
		expect(toolbarEl.className).toContain("Primeng ROCKS!");
		expect(toolbarEl.style.height).toEqual("300px");
	});

	it('should show ng-content', () => {
		fixture.detectChanges();

		const contentEl = fixture.debugElement.query(By.css('.p-toolbar-group-left')).nativeElement;
		expect(contentEl).toBeTruthy();
	});

});
{'fraction_non_alphanumeric': 0.16659321286910533, 'fraction_numerical': 0.004847950639048039, 'mean_word_length': 3.9552401746724892, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 47, 'https://': 0, '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': '358354', 'n_tokens_mistral': 1432, 'n_tokens_neox': 1373, 'n_words': 241}