-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b4cbbe
commit b0de40d
Showing
20 changed files
with
24,564 additions
and
25,077 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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,15 +1,42 @@ | ||
import Social from "components/Social" | ||
import {useSiteMetadata} from "hooks" | ||
import {mockSiteMetadata} from "test-utils/mocks" | ||
import {render, screen} from "test-utils/render" | ||
|
||
test("shows social", () => { | ||
jest.mock("hooks") | ||
useSiteMetadata.mockReturnValue(mockSiteMetadata) | ||
|
||
test("shows twitter", () => { | ||
render(<Social />) | ||
|
||
expect(screen.getByLabelText("Twitter")).toHaveAttribute( | ||
"href", | ||
`https://twitter.com/${mockSiteMetadata.twitter}`, | ||
) | ||
}) | ||
|
||
test("shows youtube", () => { | ||
render(<Social />) | ||
|
||
const socials = ["Twitter", "YouTube", "Instagram", "Spotify"] | ||
expect(screen.getByLabelText("YouTube")).toHaveAttribute( | ||
"href", | ||
`https://youtube.com/channel/${mockSiteMetadata.youtube}`, | ||
) | ||
}) | ||
|
||
test("shows instagram", () => { | ||
render(<Social />) | ||
|
||
expect(screen.getByLabelText("Instagram")).toHaveAttribute( | ||
"href", | ||
`https://instagram.com/${mockSiteMetadata.instagram}`, | ||
) | ||
}) | ||
test("shows spotify", () => { | ||
render(<Social />) | ||
|
||
socials.forEach(social => { | ||
expect(screen.getByLabelText(social)).toHaveAttribute( | ||
"href", | ||
`/${social.toLowerCase()}`, | ||
) | ||
}) | ||
expect(screen.getByLabelText("Spotify")).toHaveAttribute( | ||
"href", | ||
`https://open.spotify.com/user/${mockSiteMetadata.spotify}`, | ||
) | ||
}) |
This file contains 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 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