Skip to content

Commit

Permalink
ArticlesPanel tests passing again
Browse files Browse the repository at this point in the history
  • Loading branch information
devadeka committed Mar 10, 2019
1 parent bb9d189 commit cc32aed
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/tests/ArticlesPanel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,30 @@ import React from 'react';

describe('<ArticleDetailView />', () => {
let articlesPanel;
const articles = [1, 2, 4].map(articleNum => ({
title: `Article ${articleNum}`

const setArticlesData = jest.fn();
const setSelectedArticle = jest.fn();

const articles = [1, 2, 3].map(elem => ({
id: elem,
title: `Article ${elem}`,
body: '...'
}));

const articlesData = {
page: 1,
page_count: 5,
articles: articles
};


beforeEach( () => {
articlesPanel = mount(<ArticlesPanel articles={articles} />);
articlesPanel = mount(
<ArticlesPanel
articlesData={ articlesData }
setArticlesData={ setArticlesData }
setSelectedArticle={ setSelectedArticle }
/>);
});

it('contains a <Pagination />', () => {
Expand Down

0 comments on commit cc32aed

Please sign in to comment.