// Copyright 2020 Cognite AS import { CogniteWellsClient, WellboreSourceItems, WellboreSourcesFilterRequest, } from "src"; import { setupLoggedInClient } from "../testUtils"; let client: CogniteWellsClient; beforeAll(async () => { client = await setupLoggedInClient(); }); test("get list of all wellbore sources", async () => { expect(client).not.toBeUndefined(); const wellboreSources: WellboreSourceItems = await client.wellboreSources.list({}); expect(wellboreSources).not.toBeUndefined(); expect(wellboreSources.items.length).not.toBe(0); const actual = wellboreSources.items.map( (wellboreSource) => wellboreSource.source.sourceName ); expect(actual).toMatchObject([ "VOLVE", "VOLVE", "VOLVE", "VOLVE", "VOLVE", "VOLVE", "VOLVE", "VOLVE", "VOLVE", "VOLVE", "VOLVE", "EDM", ]); }); test("get list of wellbore sources from source EDM", async () => { expect(client).not.toBeUndefined(); const request: WellboreSourcesFilterRequest = { filter: { sources: ["EDM"], }, }; const wellboreSources: WellboreSourceItems = await client.wellboreSources.list(request); expect(wellboreSources).not.toBeUndefined(); expect(wellboreSources.items.length).not.toBe(0); const actual = wellboreSources.items.map( (wellboreSource) => wellboreSource.source.sourceName ); expect(actual).toMatchObject(["EDM"]); });