diff --git a/src/tests/integration/photos.test.ts b/src/tests/integration/photos.test.ts index 9aacbb5..a9fb5b3 100644 --- a/src/tests/integration/photos.test.ts +++ b/src/tests/integration/photos.test.ts @@ -114,6 +114,8 @@ describe("photos", function () { }); expect(dbPhoto.hash).to.be.equal(dogHash); + expect(await dbPhoto.isUploaded()).to.be.equal(false); + await request(callback) .post(`/photos/upload/${photo.id}`) .set({ @@ -123,6 +125,8 @@ describe("photos", function () { .attach("photo", dogPath) .expect(200); + expect(await dbPhoto.isUploaded()).to.be.equal(true); + const showResp = await request(callback) .get(`/photos/showByID/${photo.id}`) .set({ @@ -159,6 +163,7 @@ describe("photos", function () { user: seed.user1.id as any, }); expect(dbPhoto.hash).to.be.equal(dogHash); + expect(await dbPhoto.isUploaded()).to.be.equal(false); await request(callback) .post(`/photos/upload/${photo.id}`) @@ -168,6 +173,8 @@ describe("photos", function () { }) .attach("photo", dogPath) .expect(404); + + expect(await dbPhoto.isUploaded()).to.be.equal(false); }); it("should create, upload but not show a photo to another user", async function () { @@ -194,6 +201,7 @@ describe("photos", function () { user: seed.user1.id as any, }); expect(dbPhoto.hash).to.be.equal(dogHash); + expect(await dbPhoto.isUploaded()).to.be.equal(false); await request(callback) .post(`/photos/upload/${photo.id}`) @@ -204,6 +212,8 @@ describe("photos", function () { .attach("photo", dogPath) .expect(200); + expect(await dbPhoto.isUploaded()).to.be.equal(true); + await request(callback) .get(`/photos/showByID/${photo.id}`) .set({