UNPKG

@itwin/insights-client

Version:

Insights client for the iTwin platform

56 lines 2.31 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import * as chaiAsPromised from "chai-as-promised"; import { expect, use } from "chai"; import "reflect-metadata"; import { accessToken, configurationsClient, iTwinId, jobsClient, reportsClient } from "../utils/GlobalSetup"; use(chaiAsPromised); describe("EC3JobsClient (report schema)", () => { let configurationId; let reportId; before(async () => { const newReport = { displayName: "testReport", projectId: iTwinId, }; const report = await reportsClient.createReport(accessToken, newReport); reportId = report.id; const material = { nameColumn: "materialName", }; const label = { name: "name", reportTable: "table", elementNameColumn: "elementName", elementQuantityColumn: "elementQuantity", materials: [material], }; const newConfig = { reportId: report.id, displayName: "Test", labels: [label], }; const config = await configurationsClient.createConfiguration(accessToken, newConfig); configurationId = config.id; }); after(async () => { await configurationsClient.deleteConfiguration(accessToken, configurationId); await reportsClient.deleteReport(accessToken, reportId); }); it("jobs - run extraction and get status", async () => { const newJob = { projectName: "test", ec3BearerToken: "no token :(", configurationId, }; const job = await jobsClient.createJob(accessToken, newJob); expect(job).to.not.be.undefined; expect(job.id).to.not.be.undefined; const status = await jobsClient.getEC3JobStatus(accessToken, job.id); expect(status).to.not.be.undefined; expect(["Failed", "Running", "Queued"]).to.include(status.status); }); }); //# sourceMappingURL=EC3JobsClientReport.test.js.map