AAE-40102 Fix (#11363)

This commit is contained in:
Wiktor Danielewski
2025-11-20 10:53:07 +01:00
committed by GitHub
parent fbc647459f
commit 3b05504e65
2 changed files with 19 additions and 2 deletions
@@ -65,6 +65,24 @@ describe('ButtonWidgetComponent', () => {
expect(await button.isDisabled()).toBe(true);
});
it('should disable button when the field reference remains the same but the readOnly property changes', async () => {
const sameFieldRef = { ...mockField, readOnly: false };
fixture.componentRef.setInput('field', sameFieldRef);
const button = await getButton();
const disabledBeforeChange = await button.isDisabled();
sameFieldRef.readOnly = true;
fixture.componentRef.setInput('field', sameFieldRef);
const disabledAfterChange = await button.isDisabled();
expect(disabledBeforeChange).toBe(false);
expect(disabledAfterChange).toBe(true);
});
it('should attach className to the widget host element', () => {
fixture.detectChanges();
@@ -17,7 +17,7 @@
/* eslint-disable @angular-eslint/component-selector */
import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';
import { Component, ViewEncapsulation } from '@angular/core';
import { WidgetComponent } from '../widget.component';
import { FormService } from '../../../services/form.service';
import { TranslatePipe } from '@ngx-translate/core';
@@ -32,7 +32,6 @@ import { MatTooltipModule } from '@angular/material/tooltip';
'[class]': 'hostClasses'
},
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [TranslatePipe, MatButtonModule, MatTooltipModule]
})
export class ButtonWidgetComponent extends WidgetComponent {