diff --git a/views/components/__test__/__snapshots__/Footer.spec.tsx.snap b/views/components/__test__/__snapshots__/Footer.spec.tsx.snap index a4b8bf74..97b9ad6d 100644 --- a/views/components/__test__/__snapshots__/Footer.spec.tsx.snap +++ b/views/components/__test__/__snapshots__/Footer.spec.tsx.snap @@ -111,135 +111,142 @@ exports[`Footer should render without throwing an error 1`] = ` - - - - - - - - -
- - - - - - - - + > +
+ + + + + + + + +
diff --git a/views/components/footer/GoTop.js b/views/components/footer/GoTop.js index d592a928..e55f6d9b 100644 --- a/views/components/footer/GoTop.js +++ b/views/components/footer/GoTop.js @@ -2,11 +2,14 @@ import React from 'react' import styled from 'styled-components/macro' import Icon from '~/views/components/common/Icon' import { HOME } from '~/consts/pages' +import Link from 'next/link' const GoTop = () => ( - - - + + + + + ) export default GoTop diff --git a/views/components/nav/NavItem.js b/views/components/nav/NavItem.js index c43997ad..644f713f 100644 --- a/views/components/nav/NavItem.js +++ b/views/components/nav/NavItem.js @@ -2,6 +2,7 @@ import React from 'react' import PropTypes from 'prop-types' import styled from 'styled-components/macro' import { Translate } from 'react-localize-redux' +import Link from 'next/link' const NavItem = ({ page, isSelected, setSelectedPage }) => { return isSelected ? ( @@ -9,15 +10,16 @@ const NavItem = ({ page, isSelected, setSelectedPage }) => { ) : ( - { - setSelectedPage(page) - }} - > - - + + { + setSelectedPage(page) + }} + > + + + ) } diff --git a/views/components/nav/__test__/NavItem.spec.tsx b/views/components/nav/__test__/NavItem.spec.tsx index decf3666..c266c0e3 100644 --- a/views/components/nav/__test__/NavItem.spec.tsx +++ b/views/components/nav/__test__/NavItem.spec.tsx @@ -1,6 +1,20 @@ import * as React from 'react' import { shallowWithTheme, mountWithTheme } from '~/utils/withThemeProviders' import NavItem from '~/views/components/nav/NavItem' +const Router = require('next/router').default; + +const actionWithPromise = () => { + return new Promise((resolve) => resolve()); +}; + +const mockedRouter = { + push: actionWithPromise, + replace: actionWithPromise, + prefetch: () => {}, +}; + +// @ts-ignore +Router.router = mockedRouter describe('Nav Item', () => { it('should render Selected NavItem', function() { diff --git a/views/components/nav/__test__/__snapshots__/NavContent.spec.tsx.snap b/views/components/nav/__test__/__snapshots__/NavContent.spec.tsx.snap index 77bf7892..980c103e 100644 --- a/views/components/nav/__test__/__snapshots__/NavContent.spec.tsx.snap +++ b/views/components/nav/__test__/__snapshots__/NavContent.spec.tsx.snap @@ -317,79 +317,83 @@ exports[`Nav Content should render with isShowNavContent disable 1`] = ` page="About" setSelectedPage={[Function]} > - - - - - - Missing translationId: About for language: \${ languageCode } - - - - - + + Missing translationId: About for language: \${ languageCode } + + + + + + @@ -432,79 +436,83 @@ exports[`Nav Content should render with isShowNavContent disable 1`] = ` page="Experiences" setSelectedPage={[Function]} > - - - - - - Missing translationId: Experiences for language: \${ languageCode } - - - - - + + Missing translationId: Experiences for language: \${ languageCode } + + + + + + @@ -547,79 +555,83 @@ exports[`Nav Content should render with isShowNavContent disable 1`] = ` page="Certifications" setSelectedPage={[Function]} > - - - - - - Missing translationId: Certifications for language: \${ languageCode } - - - - - + + Missing translationId: Certifications for language: \${ languageCode } + + + + + + @@ -662,79 +674,83 @@ exports[`Nav Content should render with isShowNavContent disable 1`] = ` page="Projects" setSelectedPage={[Function]} > - - - - - - Missing translationId: Projects for language: \${ languageCode } - - - - - + + Missing translationId: Projects for language: \${ languageCode } + + + + + + @@ -777,79 +793,83 @@ exports[`Nav Content should render with isShowNavContent disable 1`] = ` page="Contacts" setSelectedPage={[Function]} > - - - - - - Missing translationId: Contacts for language: \${ languageCode } - - - - - + + Missing translationId: Contacts for language: \${ languageCode } + + + + + + @@ -1182,79 +1202,83 @@ exports[`Nav Content should render with isShowNavContent enable 1`] = ` page="About" setSelectedPage={[Function]} > - - - - - - Missing translationId: About for language: \${ languageCode } - - - - - + + Missing translationId: About for language: \${ languageCode } + + + + + + @@ -1297,79 +1321,83 @@ exports[`Nav Content should render with isShowNavContent enable 1`] = ` page="Experiences" setSelectedPage={[Function]} > - - - - - - Missing translationId: Experiences for language: \${ languageCode } - - - - - + + Missing translationId: Experiences for language: \${ languageCode } + + + + + + @@ -1412,79 +1440,83 @@ exports[`Nav Content should render with isShowNavContent enable 1`] = ` page="Certifications" setSelectedPage={[Function]} > - - - - - - Missing translationId: Certifications for language: \${ languageCode } - - - - - + + Missing translationId: Certifications for language: \${ languageCode } + + + + + + @@ -1527,79 +1559,83 @@ exports[`Nav Content should render with isShowNavContent enable 1`] = ` page="Projects" setSelectedPage={[Function]} > - - - - - - Missing translationId: Projects for language: \${ languageCode } - - - - - + + Missing translationId: Projects for language: \${ languageCode } + + + + + + @@ -1642,79 +1678,83 @@ exports[`Nav Content should render with isShowNavContent enable 1`] = ` page="Contacts" setSelectedPage={[Function]} > - - - - - - Missing translationId: Contacts for language: \${ languageCode } - - - - - + + Missing translationId: Contacts for language: \${ languageCode } + + + + + + diff --git a/views/components/nav/__test__/__snapshots__/NavItem.spec.tsx.snap b/views/components/nav/__test__/__snapshots__/NavItem.spec.tsx.snap index cd7c7b04..a7a153e1 100644 --- a/views/components/nav/__test__/__snapshots__/NavItem.spec.tsx.snap +++ b/views/components/nav/__test__/__snapshots__/NavItem.spec.tsx.snap @@ -1,15 +1,18 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Nav Item should render Normal NavItem 1`] = ` - - - + + + + `; exports[`Nav Item should render Selected NavItem 1`] = `