mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[affected:*][ci:force] Fixing e2e - the long painful journey
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
<mat-slider
|
||||
[min]="min"
|
||||
[max]="max"
|
||||
[step]="step"
|
||||
class="adf-search-slider"
|
||||
data-automation-id="slider-range" #ngSlider><input matSliderThumb />
|
||||
<input
|
||||
matSliderThumb
|
||||
(change)="onChangedHandler({source: ngSliderThumb, parent: ngSlider, value: ngSliderThumb.value})"
|
||||
#ngSliderThumb="matSliderThumb"
|
||||
[(value)]="value" />
|
||||
data-automation-id="slider-range"
|
||||
[max]="max"
|
||||
[min]="min"
|
||||
[step]="step"
|
||||
[discrete]="thumbLabel">
|
||||
<input matSliderThumb (change)="onChangedHandler()" [(ngModel)]="value">
|
||||
</mat-slider>
|
||||
|
||||
<div class="adf-facet-buttons" *ngIf="!settings?.hideDefaultAction">
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MatSliderChange } from '@angular/material/slider';
|
||||
import { SearchSliderComponent } from './search-slider.component';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
@@ -49,14 +48,6 @@ describe('SearchSliderComponent', () => {
|
||||
expect(component.thumbLabel).toEqual(settings.thumbLabel);
|
||||
});
|
||||
|
||||
it('should update value on slider change', () => {
|
||||
component.onChangedHandler({ value: 10 } as MatSliderChange);
|
||||
expect(component.value).toEqual(10);
|
||||
|
||||
component.onChangedHandler({ value: 20 } as MatSliderChange);
|
||||
expect(component.value).toEqual(20);
|
||||
});
|
||||
|
||||
it('should update its query part on slider change', () => {
|
||||
const context: any = {
|
||||
queryFragments: {},
|
||||
@@ -68,13 +59,15 @@ describe('SearchSliderComponent', () => {
|
||||
component.context = context;
|
||||
component.id = 'contentSize';
|
||||
component.settings = { field: 'cm:content.size' };
|
||||
component.value = 10;
|
||||
fixture.detectChanges();
|
||||
|
||||
component.onChangedHandler({ value: 10 } as MatSliderChange);
|
||||
component.onChangedHandler();
|
||||
expect(context.queryFragments[component.id]).toEqual('cm:content.size:[0 TO 10]');
|
||||
expect(context.update).toHaveBeenCalled();
|
||||
|
||||
component.onChangedHandler({ value: 20 } as MatSliderChange);
|
||||
component.value = 20;
|
||||
component.onChangedHandler();
|
||||
expect(context.queryFragments[component.id]).toEqual('cm:content.size:[0 TO 20]');
|
||||
});
|
||||
|
||||
|
@@ -19,7 +19,6 @@ import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { SearchWidget } from '../../models/search-widget.interface';
|
||||
import { SearchWidgetSettings } from '../../models/search-widget-settings.interface';
|
||||
import { SearchQueryBuilderService } from '../../services/search-query-builder.service';
|
||||
import { MatSliderChange } from '@angular/material/slider';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
@@ -82,8 +81,7 @@ export class SearchSliderComponent implements SearchWidget, OnInit {
|
||||
this.updateQuery(null);
|
||||
}
|
||||
|
||||
onChangedHandler(event: MatSliderChange) {
|
||||
this.value = event.value;
|
||||
onChangedHandler() {
|
||||
if (this.enableChangeUpdate) {
|
||||
this.updateQuery(this.value);
|
||||
}
|
||||
|
Reference in New Issue
Block a user