AAE-30110 Render sections in runtime (#10599)

* AAE-30110 Render sections in runtime

* Move section to separate component

* Improve sections styles

* added early return improvement

* fix process services unit tests

* use testingUtils

* fix styles

* fix lint header error
This commit is contained in:
Tomasz Gnyp
2025-02-12 12:37:17 +01:00
committed by GitHub
parent 287519ee24
commit 2284ede0c7
20 changed files with 997 additions and 206 deletions

View File

@@ -152,12 +152,12 @@ describe('FormComponent UI and visibility', () => {
fixture.detectChanges();
const firstEl = fixture.debugElement.query(By.css('#field-country-container'));
expect(firstEl.nativeElement.style.visibility).toBe('hidden');
expect(firstEl.nativeElement.style.display).toBe('none');
const secondEl = fixture.debugElement.query(By.css('#name'));
expect(secondEl).not.toBeNull();
expect(secondEl).toBeDefined();
expect(fixture.nativeElement.querySelector('#field-name-container').style.visibility).not.toBe('hidden');
expect(fixture.nativeElement.querySelector('#field-name-container').style.display).toBe('block');
});
it('should hide the field based on the previous one', () => {
@@ -171,10 +171,10 @@ describe('FormComponent UI and visibility', () => {
const firstEl = fixture.debugElement.query(By.css('#name'));
expect(firstEl).not.toBeNull();
expect(firstEl).toBeDefined();
expect(fixture.nativeElement.querySelector('#field-name-container').style.visibility).not.toBe('hidden');
expect(fixture.nativeElement.querySelector('#field-name-container').style.display).toBe('block');
const secondEl = fixture.debugElement.query(By.css('#field-country-container'));
expect(secondEl.nativeElement.style.visibility).toBe('hidden');
expect(secondEl.nativeElement.style.display).toBe('none');
});
it('should show the hidden field when the visibility condition change to true', () => {
@@ -186,10 +186,10 @@ describe('FormComponent UI and visibility', () => {
fixture.detectChanges();
let firstEl = fixture.debugElement.query(By.css('#field-country-container'));
expect(firstEl.nativeElement.style.visibility).toBe('hidden');
expect(firstEl.nativeElement.style.display).toBe('none');
const secondEl = fixture.debugElement.query(By.css('#field-name-container'));
expect(secondEl.nativeElement.style.visibility).not.toBe('hidden');
expect(secondEl.nativeElement.style.display).toBe('block');
const inputElement = fixture.nativeElement.querySelector('#name');
inputElement.value = 'italy';
@@ -197,7 +197,7 @@ describe('FormComponent UI and visibility', () => {
fixture.detectChanges();
firstEl = fixture.debugElement.query(By.css('#field-country-container'));
expect(firstEl.nativeElement.style.visibility).not.toBe('hidden');
expect(firstEl.nativeElement.style.display).toBe('block');
});
});

View File

@@ -511,9 +511,9 @@ describe('TaskFormComponent', () => {
fixture.detectChanges();
await fixture.whenStable();
const inputThreeContainer = fixture.nativeElement.querySelector('#field-text3-container');
expect(inputThreeContainer.style.visibility).toBe('hidden');
expect(inputThreeContainer.style.display).toBe('none');
const completeOutcomeButton: HTMLButtonElement = fixture.nativeElement.querySelector('#adf-form-complete');
expect(completeOutcomeButton.style.visibility).not.toBe('hidden');
expect(completeOutcomeButton.style.display).not.toBe('none');
completeOutcomeButton.click();
fixture.detectChanges();
});