2 Commits

Author SHA1 Message Date
c77fe19ed1 Add description in Header + Change title 2020-12-18 02:27:15 +01:00
0b7b64231d Replace films page H2 by Studio Ghibli logo 2020-12-18 02:18:01 +01:00
5 changed files with 18 additions and 8 deletions

BIN
assets/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -4,7 +4,7 @@ import Header from "./";
describe("Header", () => { describe("Header", () => {
it("should render Header instance", () => { it("should render Header instance", () => {
const wrapper = mount(Header, { stubs: ["router-link"] }); const wrapper = mount(Header, { stubs: ["router-link"] });
expect(wrapper.find("h1").text()).toBe("Ghibli"); expect(wrapper.find("h1").text()).toBe("PeopleDoc");
}); });
it("should redirect to Home page when clicking on brand logo", () => { it("should redirect to Home page when clicking on brand logo", () => {

View File

@@ -1,7 +1,7 @@
<template> <template>
<header <header
id="header" id="header"
class="fixed top-0 left-0 w-screen bg-white h-16 px-4 py-3 shadow-md" class="fixed top-0 left-0 w-screen bg-white h-16 px-4 py-3 shadow-md flex items-center justify-between"
> >
<router-link to="/" class="flex w-auto h-full items-center"> <router-link to="/" class="flex w-auto h-full items-center">
<img <img
@@ -9,14 +9,22 @@
src="https://avatars2.githubusercontent.com/u/1080062?s=200&v=4" src="https://avatars2.githubusercontent.com/u/1080062?s=200&v=4"
alt="PeopleDoc - Icon" alt="PeopleDoc - Icon"
/> />
<h1 class="text-2xl font-light tracking-wide">Ghibli</h1> <h1 class="text-2xl font-light tracking-wide">PeopleDoc</h1>
</router-link> </router-link>
<h2 class="font-medium hidden sm:block">{{ description }}</h2>
</header> </header>
</template> </template>
<script> <script>
import pkg from "@/package.json";
export default { export default {
name: "Header" name: "Header",
computed: {
description: function() {
return pkg.description;
}
}
}; };
</script> </script>

View File

@@ -1,8 +1,10 @@
<template> <template>
<section class="py-4"> <section class="py-4">
<h2 class="text-3xl font-normal mx-auto block text-center mb-4"> <img
Ghibli films class="w-full max-w-md mx-auto mb-8"
</h2> src="~/assets/images/logo.png"
alt="Studio Ghibli"
/>
<Grid :dataSource="films" /> <Grid :dataSource="films" />
</section> </section>
</template> </template>

View File

@@ -10,7 +10,7 @@ jest.mock("axios", () => ({
describe("Films page", () => { describe("Films page", () => {
it("should render Films page instance", () => { it("should render Films page instance", () => {
const wrapper = mount(FilmsView); const wrapper = mount(FilmsView);
expect(wrapper.find("h2").text()).toBe("Ghibli films"); expect(wrapper.find("img").exists()).toBe(true);
}); });
it("should get films from Ghibli API", async () => { it("should get films from Ghibli API", async () => {