mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 15:47:53 -05:00
Update tests
This commit is contained in:
parent
cc66341252
commit
53414e11a9
1 changed files with 6 additions and 0 deletions
|
@ -7,10 +7,14 @@ describe('Studio comments', () => {
|
||||||
const loadComments = jest.fn();
|
const loadComments = jest.fn();
|
||||||
const component = mountWithIntl(
|
const component = mountWithIntl(
|
||||||
<StudioComments
|
<StudioComments
|
||||||
|
hasFetchedSession={false}
|
||||||
comments={[]}
|
comments={[]}
|
||||||
handleLoadMoreComments={loadComments}
|
handleLoadMoreComments={loadComments}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
expect(loadComments).not.toHaveBeenCalled();
|
||||||
|
component.setProps({hasFetchedSession: true});
|
||||||
|
component.update();
|
||||||
expect(loadComments).toHaveBeenCalled();
|
expect(loadComments).toHaveBeenCalled();
|
||||||
|
|
||||||
// When updated to have comments, load is not called again
|
// When updated to have comments, load is not called again
|
||||||
|
@ -30,6 +34,7 @@ describe('Studio comments', () => {
|
||||||
const resetComments = jest.fn();
|
const resetComments = jest.fn();
|
||||||
const component = mountWithIntl(
|
const component = mountWithIntl(
|
||||||
<StudioComments
|
<StudioComments
|
||||||
|
hasFetchedSession
|
||||||
isAdmin={false}
|
isAdmin={false}
|
||||||
comments={[{id: 123, author: {}}]}
|
comments={[{id: 123, author: {}}]}
|
||||||
handleResetComments={resetComments}
|
handleResetComments={resetComments}
|
||||||
|
@ -57,6 +62,7 @@ describe('Studio comments', () => {
|
||||||
mountWithIntl(
|
mountWithIntl(
|
||||||
<StudioComments
|
<StudioComments
|
||||||
isAdmin
|
isAdmin
|
||||||
|
hasFetchedSession
|
||||||
comments={[{id: 123, author: {}}]}
|
comments={[{id: 123, author: {}}]}
|
||||||
handleResetComments={resetComments}
|
handleResetComments={resetComments}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in a new issue