93219: Add (more) reusable functions to test DataService composition

Data services that implement *Data interfaces should include the appropriate test functions in their specs.
These go over all methods in the interface & check that they're "wired up" correctly.

See e.g. the change in ExternalSourceDataService for an issue that is easy to miss but was highlighted by these new tests
This commit is contained in:
Yury Bondarenko
2022-09-12 17:37:54 +02:00
parent 8b4dbbad55
commit 147c7180d0
34 changed files with 442 additions and 75 deletions

View File

@@ -4,6 +4,7 @@ import { createPaginatedList } from '../../shared/testing/utils.test';
import { ExternalSourceEntry } from '../shared/external-source-entry.model';
import { of as observableOf } from 'rxjs';
import { GetRequest } from './request.models';
import { testSearchDataImplementation } from './base/search-data.spec';
describe('ExternalSourceService', () => {
let service: ExternalSourceDataService;
@@ -57,6 +58,11 @@ describe('ExternalSourceService', () => {
init();
});
describe('composition', () => {
const initService = () => new ExternalSourceDataService(null, null, null, null);
testSearchDataImplementation(initService);
});
describe('getExternalSourceEntries', () => {
let result;