remaining unit test fixes for the Angular 15 update (#9218)

* removing excludes from working tests

* test fixes for CategoriesManagementComponent

* [ci:force] reenabling tests / fixes

* fixes in process-services-cloud

* change html element type

* fix selector in StartProcessComponent
This commit is contained in:
Wojciech Duda
2024-01-09 13:28:46 +01:00
committed by VitoAlbano
parent 00a64c820c
commit 2ebb5ff240
7 changed files with 43 additions and 46 deletions

View File

@@ -20,6 +20,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { RichTextEditorComponent } from './rich-text-editor.component';
import { take } from 'rxjs';
describe('RichTextEditorComponent', () => {
let component: RichTextEditorComponent;
@@ -56,9 +57,7 @@ describe('RichTextEditorComponent', () => {
await TestBed.configureTestingModule({
declarations: [RichTextEditorComponent]
}).compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(RichTextEditorComponent);
component = fixture.componentInstance;
debugElement = fixture.debugElement;

View File

@@ -125,8 +125,8 @@ describe('TaskHeaderCloudComponent', () => {
const statusEl = fixture.debugElement.query(By.css('[data-automation-id="card-textitem-value-status"]'));
expect(statusEl.nativeElement.value).toBe('ASSIGNED');
});
//eslint-disable-next-line
xit('should display priority with default values', async () => {
it('should display priority with default values', async () => {
fixture.detectChanges();
const dropdown = await loader.getHarness(MatSelectHarness);
await dropdown.open();
@@ -413,23 +413,23 @@ describe('TaskHeaderCloudComponent', () => {
fixture.detectChanges();
await fixture.whenStable();
const candidateGroup1 = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-mockgroup1"] span');
const candidateGroup2 = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-mockgroup2"] span');
const candidateGroup1 = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-mockgroup1"]');
const candidateGroup2 = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-mockgroup2"]');
expect(getCandidateGroupsSpy).toHaveBeenCalled();
expect(candidateGroup1.innerText).toBe('mockgroup1');
expect(candidateGroup2.innerText).toBe('mockgroup2');
expect(candidateGroup1.innerText).toContain('mockgroup1');
expect(candidateGroup2.innerText).toContain('mockgroup2');
});
//eslint-disable-next-line
xit('should display candidate user', async () => {
it('should display candidate user', async () => {
component.ngOnChanges();
fixture.detectChanges();
await fixture.whenStable();
const candidateUser1 = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-mockuser1"] span');
const candidateUser2 = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-mockuser2"] span');
const candidateUser1 = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-mockuser1"]');
const candidateUser2 = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-mockuser2"]');
expect(getCandidateUsersSpy).toHaveBeenCalled();
expect(candidateUser1.innerText).toBe('mockuser1');
expect(candidateUser2.innerText).toBe('mockuser2');
expect(candidateUser1.innerText).toContain('mockuser1');
expect(candidateUser2.innerText).toContain('mockuser2');
});
it('should display placeholder if no candidate groups', async () => {