mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
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:
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -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();
|
||||
});
|
||||
|
Reference in New Issue
Block a user