Compare commits
5 Commits
grid-compo
...
film-compo
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b36ad6a81 | |||
| c77fe19ed1 | |||
| 0b7b64231d | |||
| 5de7b3d676 | |||
| cde972e20e |
BIN
assets/images/logo.png
Normal file
BIN
assets/images/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<article
|
<article
|
||||||
class="film bg-gray-100 prose prose-sm rounded-md shadow-md transition-shadow duration-300 hover:shadow-xl mb-4 sm:m-4"
|
class="film flex flex-col justify-between bg-gray-100 prose prose-sm rounded-md shadow-md transition-shadow duration-300 hover:shadow-xl mb-4 sm:m-4"
|
||||||
>
|
>
|
||||||
<header class="p-4 rounded-t-md">
|
<header class="p-4 rounded-t-md">
|
||||||
<h1>
|
<h1>
|
||||||
@@ -56,6 +56,19 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="css" scoped>
|
<style lang="css" scoped>
|
||||||
|
@media screen and (min-width: 640px) {
|
||||||
|
.film {
|
||||||
|
margin: 1rem;
|
||||||
|
flex: 1 1 calc(50% - 2rem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 1024px) {
|
||||||
|
.film {
|
||||||
|
flex: 1 1 calc(33% - 2rem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
header {
|
header {
|
||||||
background-color: #85ffbd;
|
background-color: #85ffbd;
|
||||||
background-image: linear-gradient(45deg, #85ffbd 0%, #fffb7d 100%);
|
background-image: linear-gradient(45deg, #85ffbd 0%, #fffb7d 100%);
|
||||||
|
|||||||
9
components/Footer/Footer.spec.js
Normal file
9
components/Footer/Footer.spec.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { mount } from "@vue/test-utils";
|
||||||
|
import Footer from "./";
|
||||||
|
|
||||||
|
describe("Footer", () => {
|
||||||
|
it("should render Footer instance", () => {
|
||||||
|
const wrapper = mount(Footer);
|
||||||
|
expect(wrapper.exists()).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex flex-wrap">
|
<div class="flex flex-wrap justify-center">
|
||||||
<Film :key="film.id" v-for="film in dataSource" :film="film" />
|
<Film :key="film.id" v-for="film in dataSource" :film="film" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
<template>
|
|
||||||
<header
|
|
||||||
id="header"
|
|
||||||
class="fixed top-0 left-0 w-screen bg-white h-16 px-4 py-3 shadow-md"
|
|
||||||
>
|
|
||||||
<router-link to="/" class="flex w-auto h-full items-center">
|
|
||||||
<img
|
|
||||||
class="h-full mr-4"
|
|
||||||
src="https://avatars2.githubusercontent.com/u/1080062?s=200&v=4"
|
|
||||||
alt="PeopleDoc - Icon"
|
|
||||||
/>
|
|
||||||
<h1 class="text-2xl font-light tracking-wide">Ghibli</h1>
|
|
||||||
</router-link>
|
|
||||||
</header>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "Header"
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style></style>
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import { mount, RouterLinkStub } from "@vue/test-utils";
|
import { mount, RouterLinkStub } from "@vue/test-utils";
|
||||||
import Header from "@/components/Header";
|
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", () => {
|
||||||
31
components/Header/index.vue
Normal file
31
components/Header/index.vue
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<template>
|
||||||
|
<header
|
||||||
|
id="header"
|
||||||
|
class="fixed top-0 left-0 w-screen bg-white h-16 px-4 md:px-8 py-3 shadow-md flex items-center justify-between"
|
||||||
|
>
|
||||||
|
<router-link to="/" class="flex w-auto h-full items-center">
|
||||||
|
<img
|
||||||
|
class="h-full mr-4"
|
||||||
|
src="https://avatars2.githubusercontent.com/u/1080062?s=200&v=4"
|
||||||
|
alt="PeopleDoc - Icon"
|
||||||
|
/>
|
||||||
|
<h1 class="text-2xl font-light tracking-wide">PeopleDoc</h1>
|
||||||
|
</router-link>
|
||||||
|
<h2 class="font-medium hidden sm:block">{{ description }}</h2>
|
||||||
|
</header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import pkg from "@/package.json";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Header",
|
||||||
|
computed: {
|
||||||
|
description: function() {
|
||||||
|
return pkg.description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -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 () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user