-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[election-ui-js] Use Prettier to autoformat code
- Loading branch information
1 parent
a537490
commit 6ab11a8
Showing
24 changed files
with
336 additions
and
227 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.* | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
30 changes: 16 additions & 14 deletions
30
election-ui-javascript/src/components/PartyLinks/PartyLinks.test.js
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,24 +1,26 @@ | ||
import { render } from '@testing-library/react'; | ||
import PartyLinks from '.'; | ||
import { render } from "@testing-library/react"; | ||
import PartyLinks from "."; | ||
|
||
test('renders party links as a list', async () => { | ||
const { container } = render(<PartyLinks/>); | ||
test("renders party links as a list", async () => { | ||
const { container } = render(<PartyLinks />); | ||
|
||
const partyLinks = container.querySelector('.Party-links') | ||
expect(partyLinks.nodeName).toBe('UL'); | ||
const partyLinks = container.querySelector(".Party-links"); | ||
expect(partyLinks.nodeName).toBe("UL"); | ||
}); | ||
|
||
test('renders all the party links', async () => { | ||
const { container } = render(<PartyLinks/>); | ||
test("renders all the party links", async () => { | ||
const { container } = render(<PartyLinks />); | ||
|
||
const partyLink = container.querySelectorAll('li.Party-link') | ||
const partyLink = container.querySelectorAll("li.Party-link"); | ||
expect(partyLink.length).toBe(6); | ||
}); | ||
|
||
test('renders a party link with the correct text and href', async () => { | ||
const { container } = render(<PartyLinks/>); | ||
test("renders a party link with the correct text and href", async () => { | ||
const { container } = render(<PartyLinks />); | ||
|
||
const partyLinksAnchorTag = container.querySelector('.Party-link a') | ||
expect(partyLinksAnchorTag.textContent).toBe('Hippo Party'); | ||
expect(partyLinksAnchorTag.href).toBe('https://en.wikipedia.org/wiki/Hippopotamus'); | ||
const partyLinksAnchorTag = container.querySelector(".Party-link a"); | ||
expect(partyLinksAnchorTag.textContent).toBe("Hippo Party"); | ||
expect(partyLinksAnchorTag.href).toBe( | ||
"https://en.wikipedia.org/wiki/Hippopotamus" | ||
); | ||
}); |
24 changes: 12 additions & 12 deletions
24
election-ui-javascript/src/components/PartyLinks/index.js
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 |
---|---|---|
|
@@ -18,4 +18,4 @@ | |
|
||
.Scorecard-table tbody tr:nth-of-type(2n + 1) { | ||
background-color: white; | ||
} | ||
} |
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
Oops, something went wrong.