mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2007] Info Drawer - currentTab event should return a key not the label (#2715)
* [ADF-2007] bug fix Info drawer will emit the current active tab instead of the tab label Also updated the test spec * Emit tab index on clicking
This commit is contained in:
committed by
Eugenio Romano
parent
eba4399d6c
commit
eba46e4e44
@@ -17,6 +17,7 @@
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatTabChangeEvent } from '@angular/material';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { MaterialModule } from '../material.module';
|
||||
import { InfoDrawerLayoutComponent } from './info-drawer-layout.component';
|
||||
@@ -57,9 +58,8 @@ describe('InfoDrawerComponent', () => {
|
||||
it('should emit when tab is changed', () => {
|
||||
let tabEmitSpy = spyOn(component.currentTab, 'emit');
|
||||
let event = {index: 1, tab: {textLabel: 'DETAILS'}};
|
||||
component.onTabChange(event);
|
||||
expect(tabEmitSpy).toHaveBeenCalled();
|
||||
expect(tabEmitSpy).toHaveBeenCalledWith('DETAILS');
|
||||
component.onTabChange(<MatTabChangeEvent> event);
|
||||
expect(tabEmitSpy).toHaveBeenCalledWith(1);
|
||||
});
|
||||
|
||||
it('should render the title', () => {
|
||||
|
Reference in New Issue
Block a user