remove test that are probably have never been green

This commit is contained in:
eromano
2023-08-04 17:29:43 +02:00
parent 4a3a744a2d
commit bbf511655c
3 changed files with 3 additions and 54 deletions

View File

@@ -122,57 +122,5 @@ describe('CardViewKeyValuePairsItemComponent', () => {
expect(cardViewUpdateService.update).toHaveBeenCalled(); expect(cardViewUpdateService.update).toHaveBeenCalled();
expect(component.property.value.length).toBe(0); expect(component.property.value.length).toBe(0);
}); });
it('should update property on input blur', waitForAsync(() => {
spyOn(cardViewUpdateService, 'update');
component.ngOnChanges();
fixture.detectChanges();
const addButton = fixture.debugElement.query(By.css('.adf-card-view__key-value-pairs__add-btn'));
addButton.triggerEventHandler('click', null);
fixture.detectChanges();
const nameInput = fixture.debugElement.query(By.css(`[data-automation-id="card-${component.property.key}-name-input-0"]`));
const valueInput = fixture.debugElement.query(By.css(`[data-automation-id="card-${component.property.key}-value-input-0"]`));
nameInput.nativeElement.value = mockData[0].name;
nameInput.nativeElement.dispatchEvent(new Event('input'));
valueInput.nativeElement.value = mockData[0].value;
valueInput.nativeElement.dispatchEvent(new Event('input'));
fixture.whenStable().then(() => {
fixture.detectChanges();
valueInput.triggerEventHandler('blur', null);
fixture.detectChanges();
expect(cardViewUpdateService.update).toHaveBeenCalled();
expect(JSON.stringify(component.property.value)).toBe(JSON.stringify(mockData));
});
}));
it('should not update property if at least one input is empty on blur', waitForAsync(() => {
spyOn(cardViewUpdateService, 'update');
component.ngOnChanges();
fixture.detectChanges();
const addButton = fixture.debugElement.query(By.css('.adf-card-view__key-value-pairs__add-btn'));
addButton.triggerEventHandler('click', null);
fixture.detectChanges();
const valueInput = fixture.debugElement.query(By.css(`[data-automation-id="card-${component.property.key}-value-input-0"]`));
valueInput.nativeElement.value = mockData[0].value;
valueInput.nativeElement.dispatchEvent(new Event('input'));
fixture.whenStable().then(() => {
fixture.detectChanges();
valueInput.triggerEventHandler('blur', null);
fixture.detectChanges();
expect(cardViewUpdateService.update).not.toHaveBeenCalled();
});
}));
}); });
}); });

View File

@@ -1231,7 +1231,7 @@ describe('retrieve metadata on submit', () => {
NoopAnimationsModule, NoopAnimationsModule,
TranslateModule.forRoot(), TranslateModule.forRoot(),
CoreModule.forRoot(), CoreModule.forRoot(),
FormCloudModule, FormCloudModule
], ],
providers: [ providers: [
provideTranslations('app', 'resources'), provideTranslations('app', 'resources'),

View File

@@ -37,6 +37,7 @@ import { TaskCloudEngineEvent } from './../../../models/engine-event-cloud.model
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module'; import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
import { IdentityUserService } from '../../../people/services/identity-user.service'; import { IdentityUserService } from '../../../people/services/identity-user.service';
import { ApolloModule } from 'apollo-angular'; import { ApolloModule } from 'apollo-angular';
import { AuthModule } from '@alfresco/adf-core';
describe('TaskFilterCloudService', () => { describe('TaskFilterCloudService', () => {
let service: TaskFilterCloudService; let service: TaskFilterCloudService;
@@ -232,7 +233,7 @@ describe('Inject [LocalPreferenceCloudService] into the TaskFilterCloudService',
beforeEach(() => { beforeEach(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [HttpClientTestingModule, ApolloModule], imports: [HttpClientTestingModule, AuthModule, ApolloModule],
providers: [ providers: [
{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService } { provide: TASK_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService }
] ]