mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Merge pull request #1311 from Alfresco/dev-wabson-1294
Fix search control after logging out and back in
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<i mdl-upgrade class="material-icons">search</i>
|
||||
</label>
|
||||
<div [class]="getTextFieldHolderClassName()">
|
||||
<input mdl-upgrade
|
||||
<input mdl
|
||||
class="mdl-textfield__input"
|
||||
[type]="inputType"
|
||||
[autocomplete]="getAutoComplete()"
|
||||
|
@@ -35,8 +35,11 @@ describe('AlfrescoSearchControlComponent', () => {
|
||||
|
||||
let fixture: ComponentFixture<AlfrescoSearchControlComponent>;
|
||||
let component: AlfrescoSearchControlComponent, element: HTMLElement;
|
||||
let componentHandler;
|
||||
|
||||
beforeEach(async(() => {
|
||||
componentHandler = jasmine.createSpyObj('componentHandler', ['upgradeAllRegistered', 'upgradeElement']);
|
||||
window['componentHandler'] = componentHandler;
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
CoreModule
|
||||
@@ -348,7 +351,7 @@ describe('AlfrescoSearchControlComponent', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should set un-active the search after file/folder is clicked', () => {
|
||||
it('should set deactivate the search after file/folder is clicked', () => {
|
||||
component.searchActive = true;
|
||||
component.onFileClicked({
|
||||
value: 'node12345'
|
||||
@@ -357,13 +360,13 @@ describe('AlfrescoSearchControlComponent', () => {
|
||||
expect(component.searchActive).toBe(false);
|
||||
});
|
||||
|
||||
it('should reset the search term after file/folder is clicked', () => {
|
||||
it('should NOT reset the search term after file/folder is clicked', () => {
|
||||
component.liveSearchTerm = 'test';
|
||||
component.onFileClicked({
|
||||
value: 'node12345'
|
||||
});
|
||||
|
||||
expect(component.liveSearchTerm).toBe('');
|
||||
expect(component.liveSearchTerm).toBe('test');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -111,7 +111,6 @@ export class AlfrescoSearchControlComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
private onSearchTermChange(value: string): void {
|
||||
this.setAutoCompleteDisplayed(true);
|
||||
this.liveSearchTerm = value;
|
||||
this.searchControl.setValue(value, true);
|
||||
this.searchValid = this.searchControl.valid;
|
||||
@@ -171,8 +170,7 @@ export class AlfrescoSearchControlComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
onFileClicked(event): void {
|
||||
this.liveSearchTerm = '';
|
||||
this.searchActive = false;
|
||||
this.setAutoCompleteDisplayed(false);
|
||||
this.fileSelect.emit(event);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user