Skip to content

Commit c2010b5

Browse files
Fix SubscriptionsDataService no expectation tests
The test's searchData & the searchData from the SubscriptionsDataService were not linked
1 parent c1875ca commit c2010b5

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/app/shared/subscriptions/subscriptions-data.service.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
1212
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
1313
import { getMockRequestService } from '../mocks/request.service.mock';
1414
import { getMockRemoteDataBuildService } from '../mocks/remote-data-build.service.mock';
15-
import { SearchDataImpl } from '../../core/data/base/search-data';
1615
import { NotificationsServiceStub } from '../testing/notifications-service.stub';
1716
import { HALEndpointServiceStub } from '../testing/hal-endpoint-service.stub';
1817
import { createPaginatedList } from '../testing/utils.test';
@@ -22,7 +21,6 @@ describe('SubscriptionsDataService', () => {
2221

2322

2423
let service: SubscriptionsDataService;
25-
let searchData: SearchDataImpl<Subscription>;
2624

2725
let comparator: DSOChangeAnalyzer<Subscription>;
2826
let http: HttpClient;
@@ -121,11 +119,11 @@ describe('SubscriptionsDataService', () => {
121119
});
122120

123121
it('should get the subscriptions', () => {
122+
spyOn((service as any).searchData, 'searchBy');
124123
const id = 'test-id';
125124
const ePersonId = 'test-ePersonId';
126-
service.getSubscriptionsByPersonDSO(ePersonId, id).subscribe(() => {
127-
expect(searchData.searchBy).toHaveBeenCalled();
128-
});
125+
service.getSubscriptionsByPersonDSO(ePersonId, id);
126+
expect((service as any).searchData.searchBy).toHaveBeenCalled();
129127
});
130128

131129
});

0 commit comments

Comments
 (0)