mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-1431] Destination Picker: Display path of the folder in search results (#2762)
* Add initial implementation with style fixes * Further style fixes * Add tests, styling fixes
This commit is contained in:
committed by
Eugenio Romano
parent
f341137b06
commit
cb06c8a963
@@ -0,0 +1,65 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { NameLocationCellComponent } from './name-location-cell.component';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { DataRow } from '@alfresco/adf-core';
|
||||
|
||||
describe('NameLocationCellComponent', () => {
|
||||
let component: NameLocationCellComponent;
|
||||
let fixture: ComponentFixture<NameLocationCellComponent>;
|
||||
let rowData: DataRow;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [
|
||||
NameLocationCellComponent
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(NameLocationCellComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
rowData = <DataRow> {
|
||||
getValue(key) {
|
||||
if (key === 'name') {
|
||||
return 'file-name';
|
||||
} else if (key === 'path') {
|
||||
return { name: '/path/to/location' };
|
||||
}
|
||||
}
|
||||
};
|
||||
component.row = rowData;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should set fileName and location properly', () => {
|
||||
const fileName = fixture.debugElement.query(By.css('.adf-name-location-cell-name')).nativeElement.innerText;
|
||||
const location = fixture.debugElement.query(By.css('.adf-name-location-cell-location')).nativeElement.innerText;
|
||||
expect(fileName).toBe('file-name');
|
||||
expect(location).toBe('/path/to/location');
|
||||
});
|
||||
|
||||
it('should set tooltip properly', () => {
|
||||
const tooltip = fixture.debugElement.query(By.css('.adf-name-location-cell-location')).nativeElement.getAttribute('title');
|
||||
|
||||
expect(tooltip).toEqual('/path/to/location');
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user