Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions __tests__/Layout.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ describe('Layout', () => {
expect(tree.find('Header').text()).toMatch('JavaScript Design Patterns');
});

it('renders 2 links', () => {
expect(tree.find('a')).toHaveLength(2);
it('renders 1 link', () => {
expect(tree.find('header a')).toHaveLength(1);
});

it('renders 1 span', () => {
expect(tree.find('header span')).toHaveLength(1);
});

it('renders 2 toggle buttons', () => {
Expand Down Expand Up @@ -102,8 +106,12 @@ describe('Layout', () => {
expect(tree.find('Header').text()).toMatch('JavaScript Design Patterns');
});

it('renders 2 links', () => {
expect(tree.find('a')).toHaveLength(2);
it('renders 1 link', () => {
expect(tree.find('header a')).toHaveLength(1);
});

it('renders 1 span', () => {
expect(tree.find('header span')).toHaveLength(1);
});

it('renders 2 toggle buttons', () => {
Expand Down
134 changes: 80 additions & 54 deletions __tests__/components/__snapshots__/Header.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<Header /> component renders with DARK theme 1`] = `
.c4 {
.c5 {
background-color: #222222;
border: 1px solid #484848;
border-radius: 50%;
Expand All @@ -13,41 +13,41 @@ exports[`<Header /> component renders with DARK theme 1`] = `
width: 2.5rem;
}

.c4:hover {
.c5:hover {
background-color: #484848;
}

.c4:hover svg,
.c4:hover g {
.c5:hover svg,
.c5:hover g {
fill: #ffffff;
}

.c4.active {
.c5.active {
background-color: #e22a23;
border-color: #e22a23;
}

.c4.active svg,
.c4.active g {
.c5.active svg,
.c5.active g {
fill: #ffffff;
}

.c4.light {
.c5.light {
background-color: #ffffff;
border-color: #c4c4c4;
}

.c4.light svg,
.c4.light g {
.c5.light svg,
.c5.light g {
fill: #707070;
}

.c4.light:hover svg,
.c4.light:hover g {
.c5.light:hover svg,
.c5.light:hover g {
fill: #707070;
}

.c5 {
.c6 {
font-family: 'Karla',sans-serif;
padding: 1.5rem;
border-radius: 4px;
Expand Down Expand Up @@ -84,14 +84,14 @@ exports[`<Header /> component renders with DARK theme 1`] = `
display: inline-flex;
}

.c3 {
.c4 {
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
}

.c2 {
.c3 {
border-bottom: 1px solid transparent;
color: #888888;
display: -webkit-inline-box;
Expand All @@ -105,11 +105,26 @@ exports[`<Header /> component renders with DARK theme 1`] = `
text-decoration: none;
}

.c2:hover {
.c3:hover {
border-bottom: 1px solid #f5f5f5;
color: #f5f5f5;
}

.c2 {
border-bottom: 1px solid transparent;
color: #888888;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
font-size: 0.875rem;
margin: 0.5rem 2rem 0 0;
padding-bottom: 1px;
-webkit-text-decoration: none;
text-decoration: none;
color: #f5f5f5;
}

@media (min-width:769px) {
.c0 {
-webkit-box-pack: justify;
Expand All @@ -120,32 +135,30 @@ exports[`<Header /> component renders with DARK theme 1`] = `
}

<div>
<div
<header
className="c0"
>
<div
className="c1"
>
<a
<span
className="c2"
href="/"
onClick={[Function]}
>
Game
</a>
</span>
<a
className="c2"
className="c3"
href="/about"
onClick={[Function]}
>
About
</a>
</div>
<div
className="c3"
className="c4"
>
<button
className="c4"
className="c5"
onClick={[Function]}
>
<svg
Expand All @@ -172,7 +185,7 @@ exports[`<Header /> component renders with DARK theme 1`] = `
</svg>
</button>
<button
className="c4"
className="c5"
onClick={[Function]}
>
<svg
Expand All @@ -194,16 +207,16 @@ exports[`<Header /> component renders with DARK theme 1`] = `
</button>
</div>
<h1
className="c5"
className="c6"
>
JavaScript Design Patterns
</h1>
</div>
</header>
</div>
`;

exports[`<Header /> component renders with LIGHT theme 1`] = `
.c4 {
.c5 {
background-color: #f4f4f4;
border: 1px solid #e8e8e8;
border-radius: 50%;
Expand All @@ -215,41 +228,41 @@ exports[`<Header /> component renders with LIGHT theme 1`] = `
width: 2.5rem;
}

.c4:hover {
.c5:hover {
background-color: #e8e8e8;
}

.c4:hover svg,
.c4:hover g {
.c5:hover svg,
.c5:hover g {
fill: #ffffff;
}

.c4.active {
.c5.active {
background-color: #e22a23;
border-color: #e22a23;
}

.c4.active svg,
.c4.active g {
.c5.active svg,
.c5.active g {
fill: #ffffff;
}

.c4.light {
.c5.light {
background-color: #ffffff;
border-color: #aaaaaa;
}

.c4.light svg,
.c4.light g {
.c5.light svg,
.c5.light g {
fill: #cccccc;
}

.c4.light:hover svg,
.c4.light:hover g {
.c5.light:hover svg,
.c5.light:hover g {
fill: #cccccc;
}

.c5 {
.c6 {
font-family: 'Karla',sans-serif;
padding: 1.5rem;
border-radius: 4px;
Expand Down Expand Up @@ -286,14 +299,14 @@ exports[`<Header /> component renders with LIGHT theme 1`] = `
display: inline-flex;
}

.c3 {
.c4 {
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
}

.c2 {
.c3 {
border-bottom: 1px solid transparent;
color: #e22a23;
display: -webkit-inline-box;
Expand All @@ -307,11 +320,26 @@ exports[`<Header /> component renders with LIGHT theme 1`] = `
text-decoration: none;
}

.c2:hover {
.c3:hover {
border-bottom: 1px solid #707070;
color: #707070;
}

.c2 {
border-bottom: 1px solid transparent;
color: #e22a23;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
font-size: 0.875rem;
margin: 0.5rem 2rem 0 0;
padding-bottom: 1px;
-webkit-text-decoration: none;
text-decoration: none;
color: #707070;
}

@media (min-width:769px) {
.c0 {
-webkit-box-pack: justify;
Expand All @@ -322,32 +350,30 @@ exports[`<Header /> component renders with LIGHT theme 1`] = `
}

<div>
<div
<header
className="c0"
>
<div
className="c1"
>
<a
<span
className="c2"
href="/"
onClick={[Function]}
>
Game
</a>
</span>
<a
className="c2"
className="c3"
href="/about"
onClick={[Function]}
>
About
</a>
</div>
<div
className="c3"
className="c4"
>
<button
className="c4"
className="c5"
onClick={[Function]}
>
<svg
Expand All @@ -374,7 +400,7 @@ exports[`<Header /> component renders with LIGHT theme 1`] = `
</svg>
</button>
<button
className="c4"
className="c5"
onClick={[Function]}
>
<svg
Expand All @@ -396,10 +422,10 @@ exports[`<Header /> component renders with LIGHT theme 1`] = `
</button>
</div>
<h1
className="c5"
className="c6"
>
JavaScript Design Patterns
</h1>
</div>
</header>
</div>
`;
Loading