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