// (C) 2007-2019 GoodData Corporation import * as request from "supertest"; import * as express from "express"; import { projects } from "../projects"; import { IMockProject } from "../../../model/MockProject"; import { ISchema } from "../../../schema/model/Schema"; import { buildProject } from "../../../schema/builder"; it("should return list of projects", done => { const schema: ISchema = { project: { title: "My title", }, users: [ { identifier: "123456", email: "john.doe@example.com", }, ], }; const project: IMockProject = buildProject(schema); const app = projects.register(express(), project); request(app) .get("/gdc/internal/projects") .expect(200) .end((err, res) => { expect(err).toBe(null); expect(res.body).toEqual({ userProjects: { items: [], paging: { count: 0, limit: 100, offset: 0, totalCount: 0, }, }, }); done(); }); });