Skip to content
Snippets Groups Projects
Commit 91fd0cc3 authored by Gilgard's avatar Gilgard
Browse files

added route to community header

parent d5812555
No related branches found
No related tags found
1 merge request!80View tests
Pipeline #179440 failed
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`CommunityHeader component renders correctly 1`] = `
<div
class="flex items-center justify-between mx-4"
>
<router-link
class="flex-1 min-w-0"
to="/community/1"
>
<h2
class="text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:truncate"
>
String
</h2>
<div
class="mt-1 flex flex-col sm:flex-row sm:flex-wrap sm:mt-0 sm:space-x-6"
>
<div
class="mt-2 flex items-center text-sm text-gray-500"
>
<svg
aria-hidden="true"
class="flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
clip-rule="evenodd"
d="M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z"
fill-rule="evenodd"
/>
</svg>
String
</div>
</div>
</router-link>
<div>
<!-- If the user is not a member in the community, this button will show -->
<!--v-if-->
<!-- If the user is member of the community, this hamburger menu will show -->
<div>
<svg
class="w-9 h-9 cursor-pointer"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M4 6h16M4 12h16M4 18h16"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
/>
</svg>
<!--v-if-->
<!-- class="absolute" -->
</div>
</div>
</div>
`;
import { mount } from "@vue/test-utils";
import CommunityHeader from "@/components/CommunityComponents/CommunityHeader.vue";
import { route, router, $route, $router } from "../../mock-router"
describe("CommunityHeader component", () => {
let wrapper;
......@@ -18,9 +19,21 @@ describe("CommunityHeader component", () => {
picture: "String",
},
},
global: {
mocks: {
route,
router,
$route,
$router,
}
}
});
});
it("renders correctly", () => {
expect(wrapper.element).toMatchSnapshot();
});
it("is instantiated", () => {
expect(wrapper.exists()).toBeTruthy();
});
......
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