Skip to content
Snippets Groups Projects
Commit 902a3738 authored by Gilgard's avatar Gilgard
Browse files

fix tests after merge

parent 1b196639
No related branches found
No related tags found
1 merge request!66Frontend tests
Pipeline #178497 failed
......@@ -35,29 +35,27 @@ exports[`CommunityHeader component renders correctly 1`] = `
</div>
</div>
</div>
<div
class="flex"
>
<div>
<span
class="hidden sm:block"
>
<button
class="inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
type="button"
<!-- Legg dette til i button: v-if="adminStatus" -->
<svg
class="w-9 h-9 cursor-pointer"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<!-- Heroicon name: solid/pencil -->
<svg
class="h-5 w-5"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"
/>
</svg>
Edit
</button>
<path
d="M4 6h16M4 12h16M4 18h16"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
/>
</svg>
<!--v-if-->
<!-- class="absolute" -->
</span>
</div>
</div>
......
......@@ -2,34 +2,64 @@
exports[`CommunityListItem component renders correctly 1`] = `
<div
class="bg-white shadow dark:bg-gray-800 select-none cursor-pointer hover:bg-gray-50 flex items-center p-4"
data-v-app=""
>
<!-- Main modal -->
<!--v-if-->
<div
class="h-10 w-10 flex flex-col justify-center items-center mr-4"
>
<img
alt="groupIMG"
src=""
/>
</div>
<div
class="flex-1 pl-1"
class="bg-white shadow dark:bg-gray-800 select-none cursor-pointer hover:bg-gray-50 flex items-center p-4"
>
<div
class="font-medium dark:text-white"
class="h-10 w-10 flex flex-col justify-center items-center mr-4"
>
string
<svg
aria-hidden="true"
fill="none"
stroke="currentColor"
stroke-width="2"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
<!-- TODO: USE COMMUNITY IMAGE &lt;img alt="Felleskapets bilde" src="@/assets/group.png" /&gt; -->
</div>
</div>
<div
class="flex flex-row justify-center"
>
<!--v-if-->
<button
class="px-4 py-2 w-24 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80"
<div
class="flex-1 pl-1 overflow-hidden"
>
Gå til
</button>
<div
class="font-medium dark:text-white truncate"
>
string
</div>
</div>
<div
class="flex flex-row justify-center items-center"
>
<svg
aria-hidden="true"
class="max-h-6 max-w-6 shrink m-2"
fill="none"
stroke="currentColor"
stroke-width="2"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
</div>
</div>
`;
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`CommunityList component renders correctly 1`] = `
<ul>
<ul
grouplist="[object Object],[object Object]"
>
<li>
<div
class="bg-white shadow dark:bg-gray-800 select-none cursor-pointer hover:bg-gray-50 flex items-center p-4"
>
<div
class="h-10 w-10 flex flex-col justify-center items-center mr-4"
>
<img
alt="groupIMG"
src=""
/>
</div>
<div
class="flex-1 pl-1"
>
<div
class="font-medium dark:text-white"
>
string
</div>
</div>
<div
class="flex flex-row justify-center"
>
<!--v-if-->
<button
class="px-4 py-2 w-24 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80"
>
Gå til
</button>
</div>
</div>
</li>
<li>
<div
class="bg-white shadow dark:bg-gray-800 select-none cursor-pointer hover:bg-gray-50 flex items-center p-4"
>
<div
class="h-10 w-10 flex flex-col justify-center items-center mr-4"
>
<img
alt="groupIMG"
src=""
/>
</div>
<div
class="flex-1 pl-1"
>
<div
class="font-medium dark:text-white"
>
string
</div>
</div>
<div
class="flex flex-row justify-center"
>
<!--v-if-->
<button
class="px-4 py-2 w-24 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80"
>
Gå til
</button>
</div>
</div>
</li>
</ul>
`;
......@@ -31,7 +31,7 @@ exports[`ItemCard component renders correctly 1`] = `
class="text-gray-700 text-xs"
id="price"
>
0 kr
0 kr
</p>
</div>
</div>
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`MemberList component renders correctly 1`] = `
<ul>
<li>
<div
class="bg-white shadow dark:bg-gray-800 select-none cursor-pointer hover:bg-gray-50 flex items-center p-4"
>
<div
class="h-10 w-10 flex flex-col justify-center items-center mr-4"
>
<router-link
to="/profile/2"
>
<img
alt="profil"
src=""
/>
</router-link>
</div>
<div
class="flex-1 pl-1"
>
<div
class="font-medium dark:text-white"
>
erik hansen
</div>
</div>
<div
class="hidden md:block flex-auto"
>
<ul
class="flex justify-center"
>
<li>
<p
class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400"
>
Gjennomsnitts rating:
</p>
</li>
<li>
<svg
class="w-5 h-5 text-gray-300 dark:text-gray-500"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
/>
</svg>
</li>
<li>
<svg
class="w-5 h-5 text-gray-300 dark:text-gray-500"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
/>
</svg>
</li>
<li>
<svg
class="w-5 h-5 text-gray-300 dark:text-gray-500"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
/>
</svg>
</li>
<li>
<svg
class="w-5 h-5 text-gray-300 dark:text-gray-500"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
/>
</svg>
</li>
<li>
<svg
class="w-5 h-5 text-gray-300 dark:text-gray-500"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
/>
</svg>
</li>
<li>
<p
class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400"
>
"[object Promise]" out of 5
</p>
</li>
</ul>
</div>
<div
class="flex flex-row justify-center"
>
<button
class="px-4 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80"
>
Åpne chat
</button>
<!--v-if-->
</div>
</div>
</li>
<li>
<div
class="bg-white shadow dark:bg-gray-800 select-none cursor-pointer hover:bg-gray-50 flex items-center p-4"
>
<div
class="h-10 w-10 flex flex-col justify-center items-center mr-4"
>
<router-link
to="/profile/1"
>
<img
alt="profil"
src=""
/>
</router-link>
</div>
<div
class="flex-1 pl-1"
>
<div
class="font-medium dark:text-white"
>
Test Testesen
</div>
</div>
<div
class="hidden md:block flex-auto"
>
<ul
class="flex justify-center"
>
<li>
<p
class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400"
>
Gjennomsnitts rating:
</p>
</li>
<li>
<svg
class="w-5 h-5 text-gray-300 dark:text-gray-500"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
/>
</svg>
</li>
<li>
<svg
class="w-5 h-5 text-gray-300 dark:text-gray-500"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
/>
</svg>
</li>
<li>
<svg
class="w-5 h-5 text-gray-300 dark:text-gray-500"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
/>
</svg>
</li>
<li>
<svg
class="w-5 h-5 text-gray-300 dark:text-gray-500"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
/>
</svg>
</li>
<li>
<svg
class="w-5 h-5 text-gray-300 dark:text-gray-500"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
/>
</svg>
</li>
<li>
<p
class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400"
>
"[object Promise]" out of 5
</p>
</li>
</ul>
</div>
<div
class="flex flex-row justify-center"
>
<button
class="px-4 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80"
>
Åpne chat
</button>
<!--v-if-->
</div>
</div>
</li>
</ul>
`;
......@@ -8,14 +8,15 @@ describe("CommunityListItem component", () => {
wrapper = mount(CommunityListItem, {
//passing prop to component
props: {
group: {
community: {
communityId: 0,
name: "string",
description: "string",
visibility: 0,
location: "string",
picture: "string"
}
},
member: false,
}
});
});
......
import { mount } from "@vue/test-utils";
import MemberList from "@/components/CommunityComponents/MemberList.vue"
describe("MemberList component", () => {
let wrapper;
beforeEach(() => {
wrapper = mount(MemberList);
});
it("renders correctly", () => {
expect(wrapper.element).toMatchSnapshot();
});
it("is instantiated", () => {
expect(wrapper.exists()).toBeTruthy();
});
});
\ No newline at end of file
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