-
Notifications
You must be signed in to change notification settings - Fork 161
Fix: CI tests failing #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
crysfel
merged 6 commits into
Coding-Coach:development
from
linux-nerd:fix/#134_test_failing
Oct 8, 2018
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
95b5e20
Fixed failing test cases of component component
linux-nerd 9675c0e
Removed App.test.js as App.js only defines the route
linux-nerd 375561f
Moved all urls from components to config/constants.js
linux-nerd 73e2705
Added analyze mode to static to prevent the server from starting
linux-nerd 96bd2f4
Added test script in lint-staged
linux-nerd b4537ca
Updated test to test:staged and changed the order of tasks in lint-st…
linux-nerd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import React from 'react'; | ||
import { render } from 'react-testing-library'; | ||
import Contact from '../Contact'; | ||
import config from 'config/constants'; | ||
|
||
test('renders the contact component', () => { | ||
const altText = 'Person using a magnifying glass to see the details of another guy'; | ||
const { getByText, getByAltText } = render(<Contact />); | ||
|
||
expect(getByText('Contact')).toBeInTheDocument(); | ||
expect(getByAltText('people search logo')).toBeInTheDocument(); | ||
expect(getByText(process.env.REACT_APP_EMAIL)).toBeInTheDocument(); | ||
expect(getByAltText(altText, { exact: false })).toBeInTheDocument(); | ||
expect(getByText(config.contact.EMAIL)).toBeInTheDocument(); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import React from 'react'; | ||
import { render } from 'react-testing-library'; | ||
import SocialMedia from '../SocialMedia'; | ||
import config from 'config/constants'; | ||
|
||
test('renders the contact page', () => { | ||
const { container } = render(<SocialMedia />); | ||
|
||
expect(container.firstChild).toMatchSnapshot(); | ||
|
||
const href = container.querySelectorAll('a'); | ||
expect(href[0].getAttribute('href')).toEqual(process.env.REACT_APP_FB_URL); | ||
expect(href[1].getAttribute('href')).toEqual(process.env.REACT_APP_INSTA_URL); | ||
expect(href[2].getAttribute('href')).toEqual(process.env.REACT_APP_TWITTER_URL); | ||
expect(href[0].getAttribute('href')).toEqual(config.social.FB_URL); | ||
expect(href[1].getAttribute('href')).toEqual(config.social.INSTA_URL); | ||
expect(href[2].getAttribute('href')).toEqual(config.social.TWITTER_URL); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export default { | ||
contact: { | ||
EMAIL: process.env.REACT_APP_EMAIL || '[email protected]', | ||
SLACK_URL: | ||
process.env.REACT_APP_SLACK_URL || | ||
'https://join.slack.com/t/coding-coach/shared_invite/enQtNDMyMzUzNjAxODQyLTUwYTFkMzZmNGFhMzZjYTQwOWE2YWFjOGJhNzYyOGIxNDM5Zjc1YWQ4NjMwN2U5YzBlNjkwMTI2ZDNiOWQyMzM', | ||
}, | ||
social: { | ||
FB_URL: process.env.REACT_APP_FACEBOOK_URL || 'https://www.facebook.com/codingcoachio/', | ||
INSTA_URL: process.env.REACT_APP_INSTA_URL || 'https://www.instagram.com/', | ||
TWITTER_URL: process.env.REACT_APP_TWITTER_URL || 'https://twitter.com/codingcoach_io', | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2557,6 +2557,13 @@ create-react-context@^0.2.1: | |
fbjs "^0.8.0" | ||
gud "^1.0.0" | ||
|
||
cross-env@^5.2.0: | ||
version "5.2.0" | ||
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2" | ||
dependencies: | ||
cross-spawn "^6.0.5" | ||
is-windows "^1.0.0" | ||
|
||
[email protected], cross-spawn@^5.0.1, cross-spawn@^5.1.0: | ||
version "5.1.0" | ||
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" | ||
|
@@ -5201,7 +5208,7 @@ is-utf8@^0.2.0: | |
version "0.2.1" | ||
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" | ||
|
||
is-windows@^1.0.1, is-windows@^1.0.2: | ||
is-windows@^1.0.0, is-windows@^1.0.1, is-windows@^1.0.2: | ||
version "1.0.2" | ||
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
test:staged
instead of justtest
, right?Also, we should have test script before
git add
, so that we make sure thatgit add
only happens if the tests passed successfully.