Update search control component and tests ng2-forms 2.0.0

Refs #737
This commit is contained in:
Will Abson
2016-10-04 15:26:47 +01:00
parent 28783322fd
commit 8f823cf0e2
4 changed files with 16 additions and 19 deletions

View File

@@ -15,7 +15,6 @@
* limitations under the License.
*/
import { SimpleChange } from '@angular/core';
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { AlfrescoSearchControlComponent } from './alfresco-search-control.component';
import { AlfrescoSearchAutocompleteComponent } from './alfresco-search-autocomplete.component';
@@ -77,17 +76,17 @@ describe('AlfrescoSearchControlComponent', () => {
});
alfrescoSearchControlComponentFixture.detectChanges();
alfrescoSearchControlComponentFixture.componentInstance.searchTerm = 'customSearchTerm';
alfrescoSearchControlComponentFixture.componentInstance
.ngOnChanges({'searchTerm': new SimpleChange('', 'customSearchTerm')});
alfrescoSearchControlComponentFixture.detectChanges();
});
it('should emit searchChange when search term changed by user', (done) => {
alfrescoSearchControlComponentFixture.detectChanges();
alfrescoSearchControlComponentFixture.componentInstance.searchChange.subscribe(e => {
expect(e.value).toBe('customSearchTerm211');
done();
});
alfrescoSearchControlComponentFixture.detectChanges();
component.searchControl.setValue('customSearchTerm211', true);
alfrescoSearchControlComponentFixture.detectChanges();
});
describe('Component rendering', () => {