Skip to content
Snippets Groups Projects
Commit 4e328f76 authored by Håkon Eilertsen Røskaft's avatar Håkon Eilertsen Røskaft
Browse files

Linted and removed unnessesary console logs

parent d12ea056
No related branches found
No related tags found
1 merge request!157Rating load
Pipeline #182360 passed
......@@ -189,6 +189,8 @@ export default {
const postResponse = await postNewRating(ratingInfo);
console.log("posted: " + postResponse);
this.$router.push("/");
},
},
......
......@@ -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) {
......
......@@ -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;
......
<template>
<!-- A view for editing the item -->
<div class="h-screen grid md:mt-8">
<edit-item-form/>
<edit-item-form />
</div>
</template>
......
......@@ -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);
})
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment