Skip to content

Commit

Permalink
✅ Adjust unit tests to use renamed function
Browse files Browse the repository at this point in the history
  • Loading branch information
massao committed Mar 18, 2019
1 parent 9458f0a commit 7a2acea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ describe('ExplorerTransactions V2 Component', () => {
balance: accounts.genesis.balance,
detailAccount: accounts.genesis,
hideChart: true, // Props to hide chart on tests, due to no canvas support
fetchVotedDelegateInfo: jest.fn(),
};

describe('Another account', () => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/votes/votesTab.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('Votes Tab Component', () => {
const props = {
loading: [],
votes: [],
searchVotesDelegate: jest.fn(),
fetchVotedDelegateInfo: jest.fn(),
};

const options = {
Expand Down Expand Up @@ -41,7 +41,7 @@ describe('Votes Tab Component', () => {
wrapper = setup({ ...props, votes });
expect(wrapper).toContainMatchingElements(31, 'TableRow');
wrapper.find('.show-more-button').simulate('click');
expect(props.searchVotesDelegate).toHaveBeenCalled();
expect(props.fetchVotedDelegateInfo).toHaveBeenCalled();
expect(wrapper).toContainMatchingElements(61, 'TableRow');
});

Expand All @@ -57,7 +57,7 @@ describe('Votes Tab Component', () => {
wrapper = setup({ ...props, votes });
wrapper.find('.filterHolder input').simulate('change', { target: { value: 'user_100' } });
jest.advanceTimersByTime(300);
expect(props.searchVotesDelegate).toHaveBeenCalled();
expect(props.fetchVotedDelegateInfo).toHaveBeenCalled();
expect(wrapper).toContainMatchingElements(2, 'TableRow');
wrapper.find('.filterHolder input').simulate('change', { target: { value: 'not user name' } });
expect(wrapper.find('.empty-message')).toIncludeText('There are no results matching this filter');
Expand Down

0 comments on commit 7a2acea

Please sign in to comment.