diff --git a/src/components/BaseComponents/RatingModal.vue b/src/components/BaseComponents/RatingModal.vue index e65e9a4e6468259e04666083a626521ecb5af5d4..1b09b8fceae2bc0cf2764f79199aa6342c5a7463 100644 --- a/src/components/BaseComponents/RatingModal.vue +++ b/src/components/BaseComponents/RatingModal.vue @@ -189,6 +189,8 @@ export default { const postResponse = await postNewRating(ratingInfo); + console.log("posted: " + postResponse); + this.$router.push("/"); }, }, diff --git a/src/components/ItemComponents/NewItemForm.vue b/src/components/ItemComponents/NewItemForm.vue index c465454ce47d792b479751e67bad7d1645e02a6e..3ef622f2dfe0e9fa3cbb8dcbca343f5bf9c3bfac 100644 --- a/src/components/ItemComponents/NewItemForm.vue +++ b/src/components/ItemComponents/NewItemForm.vue @@ -328,7 +328,6 @@ export default { }; }, methods: { - /** * Checks validation. Checks also if any community is selected. * If no community is selected or any other field isn't valid @@ -424,7 +423,6 @@ export default { } }, - async removeImage(image) { let newImages = []; for (let i in this.item.images) { diff --git a/src/components/RentingComponents/ItemInfo.vue b/src/components/RentingComponents/ItemInfo.vue index b6fc63be4bc83b0f5a486c76f8cf796018c4d8f6..6df66e21241e7b6acf20b4461c491517701633eb 100644 --- a/src/components/RentingComponents/ItemInfo.vue +++ b/src/components/RentingComponents/ItemInfo.vue @@ -227,8 +227,7 @@ export default { ); if (isNaN(maybeRating)) { this.rating = NaN; - } - else { + } else { this.rating = maybeRating; if (this.rating > 5) this.rating = 5; else if (this.rating < 1) this.rating = 1; diff --git a/src/views/ItemViews/EditItemView.vue b/src/views/ItemViews/EditItemView.vue index cdb4f27044b4c7e19c1431a7579edef43ba38871..6ae71767e398bd1f4d768bdb4682817dcde913d3 100644 --- a/src/views/ItemViews/EditItemView.vue +++ b/src/views/ItemViews/EditItemView.vue @@ -1,7 +1,7 @@ <template> <!-- A view for editing the item --> <div class="h-screen grid md:mt-8"> - <edit-item-form/> + <edit-item-form /> </div> </template> diff --git a/tests/unit/component-tests/renting-compnents-tests/new-rent.spec.js b/tests/unit/component-tests/renting-compnents-tests/new-rent.spec.js index c4cb88e85e7a68134b52dba817ebd7375e29888b..458147edeb2d729b82043ebecec97a9158d1d876 100644 --- a/tests/unit/component-tests/renting-compnents-tests/new-rent.spec.js +++ b/tests/unit/component-tests/renting-compnents-tests/new-rent.spec.js @@ -7,8 +7,8 @@ let mockRouter; describe("Confirm and send a rent request", () => { mockRouter = { - go: jest.fn() - } + go: jest.fn(), + }; let wrapper; beforeEach(() => { @@ -24,11 +24,11 @@ describe("Confirm and send a rent request", () => { isAccepted: false, }, }, - global:{ - mocks:{ - $router: mockRouter - } - } + global: { + mocks: { + $router: mockRouter, + }, + }, }); }); @@ -51,11 +51,11 @@ describe("Confirm and send a rent request", () => { expect(axios.post).toHaveBeenCalledTimes(1); }); - it("Checks that page is reloaded when cancelButton is press", async () =>{ + it("Checks that page is reloaded when cancelButton is press", async () => { const button = wrapper.find("#cancelButton"); button.trigger("click"); await wrapper.vm.$nextTick(); expect(mockRouter.go).toHaveBeenCalledTimes(1); expect(mockRouter.go).toHaveBeenCalledWith(0); - }) + }); });