From 35712f127ddde863150a92962a65edfe5dd88d1a Mon Sep 17 00:00:00 2001 From: anishfyle Date: Fri, 13 Dec 2024 16:26:26 +0530 Subject: [PATCH] lint fix --- .../qbo-export-settings.component.spec.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/integrations/qbo/qbo-shared/qbo-export-settings/qbo-export-settings.component.spec.ts b/src/app/integrations/qbo/qbo-shared/qbo-export-settings/qbo-export-settings.component.spec.ts index ea42b34b2..ccf6fce63 100644 --- a/src/app/integrations/qbo/qbo-shared/qbo-export-settings/qbo-export-settings.component.spec.ts +++ b/src/app/integrations/qbo/qbo-shared/qbo-export-settings/qbo-export-settings.component.spec.ts @@ -76,10 +76,10 @@ describe('QboExportSettingsComponent', () => { }; const integrationsToastService = jasmine.createSpyObj('IntegrationsToastService', ['displayToastMessage']); const router = jasmine.createSpyObj('Router', ['navigate']); - + await TestBed.configureTestingModule({ declarations: [ QboExportSettingsComponent ], - imports: [ + imports: [ ReactiveFormsModule, HttpClientTestingModule // Add this import ], @@ -95,8 +95,8 @@ describe('QboExportSettingsComponent', () => { { provide: MessageService, useValue: {} }, { provide: Router, useValue: router }, { provide: 'brandingFeatureConfig', useValue: mockBrandingConfig }, - { - provide: QboEmployeeSettingsService, + { + provide: QboEmployeeSettingsService, useValue: jasmine.createSpyObj('QboEmployeeSettingsService', [ 'getEmployeeSettings', 'getDistinctQBODestinationAttributes' @@ -423,7 +423,7 @@ describe('QboExportSettingsComponent', () => { workspaceServiceSpy.setOnboardingState = jasmine.createSpy('setOnboardingState'); // Spy on the save method spyOn(component, 'save').and.callThrough(); - + // Initialize the form with required values component.exportSettingForm.patchValue({ reimbursableExpenseObject: mockExportSettingsResponse.workspace_general_settings.reimbursable_expenses_object, @@ -450,18 +450,18 @@ describe('QboExportSettingsComponent', () => { autoMapEmployee: [AutoMapEmployeeOptions.EMAIL] }); }); - + xit('should handle error when saving export settings', fakeAsync(() => { // Mock the postExportSettings to return an error exportSettingsServiceSpy.postExportSettings.and.returnValue(throwError(() => new Error('API Error'))); - + // Spy on the isAdvancedSettingAffected method to return false spyOn(component, 'isAdvancedSettingAffected').and.returnValue(false); - + // Call the save method component.save(); tick(); - + // Assert that the error handling is done correctly expect(exportSettingsServiceSpy.postExportSettings).toHaveBeenCalled(); expect(component.isSaveInProgress).toBeFalse();