Skip to content

Commit

Permalink
Merge pull request #370 from PermanentOrg/failing-maincomponent-test
Browse files Browse the repository at this point in the history
Fix failing MainComponent test
  • Loading branch information
meisekimiu authored Mar 6, 2024
2 parents 594fda5 + ecc10a2 commit e8c0b7a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/app/core/components/main/main.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ describe('MainComponent', () => {
let mockDragEvents: Subject<DragServiceEvent>;

async function init(authResponseData = defaultAuthData) {
mockDragEvents = new Subject<DragServiceEvent>();
mockDragService = jasmine.createSpyObj('DragService', [
'getDestinationFromDropTarget',
'events',
]);
mockDragService.events.and.returnValue(mockDragEvents.asObservable());
mockDragService.getDestinationFromDropTarget.and.returnValue(
new FolderVO({ type: 'type.folder.public' })
);

const config = cloneDeep(Testing.BASE_TEST_CONFIG);

config.imports.push(SharedModule);
Expand Down Expand Up @@ -83,16 +93,6 @@ describe('MainComponent', () => {
promptService = TestBed.inject(PromptService);
spyOn(promptService, 'confirm');

mockDragEvents = new Subject<DragServiceEvent>();
mockDragService = jasmine.createSpyObj('DragService', [
'getDestinationFromDropTarget',
'events',
]);
mockDragService.events.and.returnValue(mockDragEvents.asObservable());
mockDragService.getDestinationFromDropTarget.and.returnValue(
new FolderVO({ type: 'type.folder.public' })
);

fixture = TestBed.createComponent(MainComponent);
component = fixture.componentInstance;
fixture.detectChanges();
Expand Down

0 comments on commit e8c0b7a

Please sign in to comment.