@@ -6,12 +6,12 @@ import {mapStateToProps, UnconnectedStars} from "./StarsPage";
66
77describe ( "<Stars />" , ( ) => {
88 it ( "matches snapshot when rendering stars" , ( ) => {
9- const component = shallow ( < UnconnectedStars isFetching = { false } stargazers_count = { 61 } dispatch = { jest . fn ( ) } /> ) ;
9+ const component = shallow ( < UnconnectedStars isFetching = { false } stargazersCount = { 61 } dispatch = { jest . fn ( ) } /> ) ;
1010 expect ( component ) . toMatchSnapshot ( ) ;
1111 } ) ;
1212
1313 it ( "matches snapshot when rendering fetching text" , ( ) => {
14- const component = shallow ( < UnconnectedStars isFetching = { true } stargazers_count = { - 1 } dispatch = { jest . fn ( ) } /> ) ;
14+ const component = shallow ( < UnconnectedStars isFetching = { true } stargazersCount = { - 1 } dispatch = { jest . fn ( ) } /> ) ;
1515 expect ( component ) . toMatchSnapshot ( ) ;
1616 } ) ;
1717
@@ -23,22 +23,22 @@ describe("<Stars />", () => {
2323 }
2424 } ;
2525 const props = mapStateToProps ( { stars} ) ;
26- expect ( props ) . toEqual ( { isFetching : false , stargazers_count : 100 } ) ;
26+ expect ( props ) . toEqual ( { errorMessage : undefined , isFetching : false , stargazersCount : 100 } ) ;
2727 } ) ;
2828
29- it ( "dispatches LOAD_STARS action before rendering if stargazers_count === -1" , ( ) => {
29+ it ( "dispatches LOAD_STARS action before rendering if stargazersCount === -1" , ( ) => {
3030 const dispatch = jest . fn ( ) ;
3131 const expectedValue : IAction < IStars > = {
3232 type : LOAD_STARS
3333 } ;
3434 expect ( dispatch ) . not . toHaveBeenCalled ( ) ;
35- shallow ( < UnconnectedStars dispatch = { dispatch } isFetching = { false } stargazers_count = { - 1 } /> ) ;
35+ shallow ( < UnconnectedStars dispatch = { dispatch } isFetching = { false } stargazersCount = { - 1 } /> ) ;
3636 expect ( dispatch ) . toHaveBeenCalledWith ( expectedValue ) ;
3737 } ) ;
3838
39- it ( "does not dispatch LOAD_STARS action before rendering if stargazers_count !== -1" , ( ) => {
39+ it ( "does not dispatch LOAD_STARS action before rendering if stargazersCount !== -1" , ( ) => {
4040 const dispatch = jest . fn ( ) ;
41- shallow ( < UnconnectedStars dispatch = { dispatch } isFetching = { false } stargazers_count = { 10 } /> ) ;
41+ shallow ( < UnconnectedStars dispatch = { dispatch } isFetching = { false } stargazersCount = { 10 } /> ) ;
4242 expect ( dispatch ) . not . toHaveBeenCalled ( ) ;
4343 } ) ;
4444} ) ;
0 commit comments