<commit_before>import { TestBed, inject } from '@angular/core/testing';

import { PipAppbarSecondaryActionsComponent } from './appbar-secondary-actions.component';

describe('a appbar-secondary-actions component', () => {
	let component: PipAppbarSecondaryActionsComponent;

	// register all needed dependencies
	beforeEach(() => {
		TestBed.configureTestingModule({
			providers: [
				PipAppbarSecondaryActionsComponent
			]
		});
	});

	// instantiation through framework injection
	beforeEach(inject([PipAppbarSecondaryActionsComponent], (AppbarSecondaryActionsComponent) => {
		component = AppbarSecondaryActionsComponent;
	}));

	/*it('should have an instance', () => {
		expect(component).toBeDefined();
	});*/
});<commit_msg>[Appbar secondary actions] update test<commit_after>import * as assert from 'assert';
import { TestBed, inject, ComponentFixture } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import { MdMenuModule } from '@angular/material';

import { PipAppbarSecondaryActionsModule } from './appbar-secondary-actions.module';
import { PipNavPartService } from '../navpart/shared/navpart.service';
import { PipAppbarSecondaryActionsComponent } from './appbar-secondary-actions.component';


describe('a pip-appbar-secondary-actions component', () => {
	let component: PipAppbarSecondaryActionsComponent;
	let service: PipNavPartService;
	let fixture: ComponentFixture<PipAppbarSecondaryActionsComponent>;
	let de: DebugElement;
	let el: HTMLElement;
	let navPartName = 'secondary-actions';

	// register all needed dependencies
	beforeEach(() => {
		TestBed.configureTestingModule({
			imports: [
				PipAppbarSecondaryActionsModule,
				BrowserAnimationsModule,
				MdMenuModule
			],
			providers: [
				PipAppbarSecondaryActionsComponent,
				PipNavPartService
			]
		});
	});

	// instantiation through framework injection
	beforeEach(inject([PipNavPartService], (navPartSErvice: PipNavPartService) => {
		fixture = TestBed.createComponent(PipAppbarSecondaryActionsComponent);
		service = navPartSErvice;
		component = fixture.componentInstance;

		de = fixture.debugElement;
		el = de.nativeElement;
	}));

	it('should show actions', () => {
		let props = { 
			actions: [
				{title: 'settings'},
				{title: 'log out'}
			]
		};

		component.pipNavPartName = navPartName;
		service.updatePartByName(navPartName, true, props);
		expect(component.config).toEqual(props);
		fixture.detectChanges();
// TODO: how to test md-menu

		//console.log('el', el);
		//let actionItems = el.getElementsByTagName('md-icon');
		// expect(actionItems.length).toEqual(props.actions.length);
		// for (let i = 0; i < props.actions.length; i++) {
		// 	expect(actionItems[i].innerHTML).toEqual(props.actions[i]);
		// }
	});
});
{'fraction_non_alphanumeric': 0.13317191283292978, 'fraction_numerical': 0.0003459010722933241, 'mean_word_length': 5.07563025210084, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '3437816', 'n_tokens_mistral': 936, 'n_tokens_neox': 843, 'n_words': 167}