Update tests for new app document structure
This commit is contained in:
parent
e9cc8143e8
commit
aeacc4e59f
|
@ -59,14 +59,13 @@ describe("/applications", () => {
|
||||||
expect(events.app.templateImported).toBeCalledTimes(1)
|
expect(events.app.templateImported).toBeCalledTimes(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
it("creates app from file", async () => {
|
it("creates app from file", async () => {
|
||||||
const res = await request
|
const res = await request
|
||||||
.post("/api/applications")
|
.post("/api/applications")
|
||||||
.field("name", "My App")
|
.field("name", "My App")
|
||||||
.field("useTemplate", "true")
|
.field("useTemplate", "true")
|
||||||
.set(config.defaultHeaders())
|
.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("Content-Type", /json/)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
expect(res.body._id).toBeDefined()
|
expect(res.body._id).toBeDefined()
|
||||||
|
@ -107,8 +106,7 @@ describe("/applications", () => {
|
||||||
.set(config.defaultHeaders())
|
.set(config.defaultHeaders())
|
||||||
.expect("Content-Type", /json/)
|
.expect("Content-Type", /json/)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
// should have empty packages
|
expect(res.body.libraries.length).toEqual(1)
|
||||||
expect(res.body.layouts.length).toEqual(2)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -120,7 +118,7 @@ describe("/applications", () => {
|
||||||
.expect("Content-Type", /json/)
|
.expect("Content-Type", /json/)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
expect(res.body.application).toBeDefined()
|
expect(res.body.application).toBeDefined()
|
||||||
expect(res.body.layouts.length).toEqual(2)
|
expect(res.body.application.appId).toEqual(config.getAppId())
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue