diff --git a/client/src/__mocks__/gatsby.js b/client/src/__mocks__/gatsby.js new file mode 100644 index 0000000000..006a72c0ee --- /dev/null +++ b/client/src/__mocks__/gatsby.js @@ -0,0 +1,30 @@ +/* eslint-disable no-unused-vars */ +/* eslint-disable no-undef */ +const React = require('react'); + +const gatsby = jest.requireActual('gatsby'); + +module.exports = { + ...gatsby, + graphql: jest.fn(), + Link: jest.fn().mockImplementation( + // these props are invalid for an `a` tag + ({ + activeClassName, + activeStyle, + getProps, + innerRef, + partiallyActive, + ref, + replace, + to, + ...rest + }) => + React.createElement('a', { + ...rest, + href: to + }) + ), + StaticQuery: jest.fn(), + useStaticQuery: jest.fn() +}; diff --git a/client/src/client-only-routes/ShowUnsubscribed.js b/client/src/client-only-routes/ShowUnsubscribed.js index b3ba08cd5d..787fa73144 100644 --- a/client/src/client-only-routes/ShowUnsubscribed.js +++ b/client/src/client-only-routes/ShowUnsubscribed.js @@ -18,8 +18,7 @@ function ShowUnsubscribed({ unsubscribeId }) {
- - +

You have successfully been unsubscribed

@@ -38,6 +37,7 @@ function ShowUnsubscribed({ unsubscribeId }) {
) : null} +
diff --git a/client/src/client-only-routes/ShowUser.js b/client/src/client-only-routes/ShowUser.js index 5d5a5df4f9..bcf824f9bd 100644 --- a/client/src/client-only-routes/ShowUser.js +++ b/client/src/client-only-routes/ShowUser.js @@ -97,8 +97,7 @@ class ShowUser extends Component { return (
- - + @@ -132,8 +131,7 @@ class ShowUser extends Component { Report a users profile | freeCodeCamp.org - - +

Do you want to report {username} diff --git a/client/src/components/Footer/Footer.test.js b/client/src/components/Footer/Footer.test.js new file mode 100644 index 0000000000..109442f3b4 --- /dev/null +++ b/client/src/components/Footer/Footer.test.js @@ -0,0 +1,13 @@ +/* global expect */ +import React from 'react'; +import renderer from 'react-test-renderer'; +import 'jest-dom/extend-expect'; + +import Footer from './'; + +describe('