[ADF-4280] fix initial display for search-sorting-picker (#4522)

* [ADF-4280] fix initial display for search-sorting-picker

* [ADF-4280] fix unrelated error TS6133: 'renderingQueueServices' is declared but its value is never read

* [ADF-4280] update e2e test
This commit is contained in:
Suzana Dirla
2019-03-29 13:54:47 +02:00
committed by Eugenio Romano
parent 95ee2bca71
commit 888113fdc2
4 changed files with 4 additions and 5 deletions

View File

@@ -159,6 +159,7 @@ describe('Search Sorting Picker', () => {
configEditor.clickSearchConfiguration(); configEditor.clickSearchConfiguration();
configEditor.clickClearButton(); configEditor.clickClearButton();
jsonFile.sorting.options[0].ascending = false; jsonFile.sorting.options[0].ascending = false;
jsonFile.sorting.defaults[0] = { 'key': 'Size', 'label': 'Size', 'type': 'FIELD', 'field': 'content.size', 'ascending': true };
configEditor.enterBigConfigurationText(JSON.stringify(jsonFile)); configEditor.enterBigConfigurationText(JSON.stringify(jsonFile));
configEditor.clickSaveButton(); configEditor.clickSaveButton();

View File

@@ -40,7 +40,7 @@ describe('SearchSortingPickerComponent', () => {
<any> { 'key': 'description', 'label': 'Description', 'type': 'FIELD', 'field': 'cm:description', 'ascending': true } <any> { 'key': 'description', 'label': 'Description', 'type': 'FIELD', 'field': 'cm:description', 'ascending': true }
], ],
defaults: [ defaults: [
<any> { 'key': 'name', 'type': 'FIELD', 'field': 'cm:name', 'ascending': true } <any> { 'key': 'name', 'type': 'FIELD', 'field': 'cm:name', 'ascending': false }
] ]
}, },
categories: [ categories: [
@@ -64,7 +64,7 @@ describe('SearchSortingPickerComponent', () => {
component.ngOnInit(); component.ngOnInit();
expect(component.value).toEqual('name'); expect(component.value).toEqual('name');
expect(component.ascending).toBeTruthy(); expect(component.ascending).toBe(false);
}); });
it('should update query builder each time selection is changed', () => { it('should update query builder each time selection is changed', () => {

View File

@@ -39,7 +39,7 @@ export class SearchSortingPickerComponent implements OnInit {
const primary = this.queryBuilder.getPrimarySorting(); const primary = this.queryBuilder.getPrimarySorting();
if (primary) { if (primary) {
this.value = primary.key; this.value = primary.key;
this.ascending = this.getSortingOrder(); this.ascending = primary.ascending;
} }
} }

View File

@@ -124,7 +124,6 @@ describe('Test PdfViewer component', () => {
let element: HTMLElement; let element: HTMLElement;
let change: any; let change: any;
let dialog: MatDialog; let dialog: MatDialog;
let renderingQueueServices: RenderingQueueServices;
setupTestBed({ setupTestBed({
imports: [ imports: [
@@ -151,7 +150,6 @@ describe('Test PdfViewer component', () => {
beforeEach((done) => { beforeEach((done) => {
fixture = TestBed.createComponent(PdfViewerComponent); fixture = TestBed.createComponent(PdfViewerComponent);
dialog = TestBed.get(MatDialog); dialog = TestBed.get(MatDialog);
renderingQueueServices = TestBed.get(RenderingQueueServices);
element = fixture.nativeElement; element = fixture.nativeElement;
component = fixture.componentInstance; component = fixture.componentInstance;