-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apps/budgeting/proposal-list: adding conditions to show tile with acc…
…ording features - removing django list and keep react list only - adding tests
- Loading branch information
Kha
committed
Nov 25, 2021
1 parent
19cddfa
commit 622145c
Showing
9 changed files
with
78 additions
and
54 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
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
29 changes: 29 additions & 0 deletions
29
meinberlin/apps/budgeting/assets/__tests__/BudgetingProposalListItem.jest.jsx
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,29 @@ | ||
import React from 'react' | ||
import { render, screen } from '@testing-library/react' | ||
import { BudgetingProposalListItem } from '../BudgetingProposalListItem' | ||
|
||
test('render list item with vote button', () => { | ||
const proposal = { | ||
name: 'myProposal', | ||
url: 'www', | ||
creator: 'creator', | ||
created: '2021-11-11T15:37:19.490201+01:00' | ||
} | ||
render(<BudgetingProposalListItem proposal={proposal} isVotingPhase />) | ||
expect(screen.getByText('myProposal')).toBeTruthy() | ||
expect(screen.getByText('creator')).toBeTruthy() | ||
expect(screen.getByText('11. mock text 2021')).toBeTruthy() | ||
}) | ||
|
||
test('render list item with stats', () => { | ||
const proposal = { | ||
name: 'myProposal', | ||
url: 'www', | ||
creator: 'creator', | ||
created: '2021-11-11T15:37:19.490201+01:00' | ||
} | ||
render(<BudgetingProposalListItem proposal={proposal} isVotingPhase={false} />) | ||
expect(screen.getByText('myProposal')).toBeTruthy() | ||
expect(screen.getByText('creator')).toBeTruthy() | ||
expect(screen.getByText('11. mock text 2021')).toBeTruthy() | ||
}) |
2 changes: 1 addition & 1 deletion
2
.../budgeting/assets/ListItemBadges.jest.jsx → .../assets/__tests__/ListItemBadges.jest.jsx
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
2 changes: 1 addition & 1 deletion
2
...s/budgeting/assets/ListItemStats.jest.jsx → ...g/assets/__tests__/ListItemStats.jest.jsx
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
10 changes: 10 additions & 0 deletions
10
meinberlin/apps/budgeting/assets/__tests__/SpacedSpan.jest.jsx
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,10 @@ | ||
import React from 'react' | ||
import { render } from '@testing-library/react' | ||
import { SpacedSpan } from '../SpacedSpan' | ||
|
||
test('displaying spaced span', () => { | ||
const tree = render(<SpacedSpan>word</SpacedSpan>) | ||
// screen.debug() | ||
const firstSpaceSpan = tree.container.querySelector('span') | ||
expect(firstSpaceSpan.innerHTML).toBe(' ') | ||
}) |
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