From aeacc4e59f41bab81b050501ef04b7ede75608a6 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 16 Jun 2022 09:03:57 +0100 Subject: [PATCH] Update tests for new app document structure --- .../server/src/api/routes/tests/application.spec.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/server/src/api/routes/tests/application.spec.js b/packages/server/src/api/routes/tests/application.spec.js index b80e874d39..2620547298 100644 --- a/packages/server/src/api/routes/tests/application.spec.js +++ b/packages/server/src/api/routes/tests/application.spec.js @@ -59,14 +59,13 @@ describe("/applications", () => { expect(events.app.templateImported).toBeCalledTimes(1) }) - it("creates app from file", async () => { const res = await request .post("/api/applications") .field("name", "My App") .field("useTemplate", "true") .set(config.defaultHeaders()) - .attach('templateFile', 'src/api/routes/tests/data/export.txt') + .attach("templateFile", "src/api/routes/tests/data/export.txt") .expect("Content-Type", /json/) .expect(200) expect(res.body._id).toBeDefined() @@ -107,8 +106,7 @@ describe("/applications", () => { .set(config.defaultHeaders()) .expect("Content-Type", /json/) .expect(200) - // should have empty packages - expect(res.body.layouts.length).toEqual(2) + expect(res.body.libraries.length).toEqual(1) }) }) @@ -120,7 +118,7 @@ describe("/applications", () => { .expect("Content-Type", /json/) .expect(200) expect(res.body.application).toBeDefined() - expect(res.body.layouts.length).toEqual(2) + expect(res.body.application.appId).toEqual(config.getAppId()) }) }) @@ -171,7 +169,7 @@ describe("/applications", () => { .set(config.defaultHeaders()) .expect("Content-Type", /json/) .expect(200) - expect(events.app.versionUpdated).toBeCalledTimes(1) + expect(events.app.versionUpdated).toBeCalledTimes(1) }) it("should be able to revert the app client library version", async () => { // We need to first update the version so that we can then revert @@ -185,7 +183,7 @@ describe("/applications", () => { .set(config.defaultHeaders()) .expect("Content-Type", /json/) .expect(200) - expect(events.app.versionReverted).toBeCalledTimes(1) + expect(events.app.versionReverted).toBeCalledTimes(1) }) })