11import { call , takeLatest } from "redux-saga/effects" ;
2- import { STARS_FAILURE , STARS_REQUEST , STARS_SUCCESS } from "../redux/modules/starsModule" ;
2+ import { actionType } from "../redux/modules/starsModule" ;
33import makeRequest from "./makeRequest" ;
44import { fetchStars , watchStarsLoad } from "./starsSaga" ;
55import TestApi from "./TestApi" ;
@@ -10,7 +10,7 @@ describe("starsSaga", () => {
1010
1111 it ( "must call makeRequest of api.getStars" , ( ) => {
1212 const api = new TestApi ( ) ;
13- expect ( gen . next ( ) . value ) . toEqual ( call ( makeRequest , api . getStars , STARS_SUCCESS , STARS_FAILURE ) ) ;
13+ expect ( gen . next ( ) . value ) . toEqual ( call ( makeRequest , api . getStars , actionType . SUCCESS , actionType . FAILURE ) ) ;
1414 } ) ;
1515
1616 it ( "must be done" , ( ) => {
@@ -22,7 +22,7 @@ describe("starsSaga", () => {
2222 const gen = watchStarsLoad ( ) ;
2323
2424 it ( "must call takeLatest of STARS_REQUEST" , ( ) => {
25- expect ( gen . next ( ) . value ) . toEqual ( takeLatest ( STARS_REQUEST , fetchStars ) ) ;
25+ expect ( gen . next ( ) . value ) . toEqual ( takeLatest ( actionType . REQUEST , fetchStars ) ) ;
2626 } ) ;
2727
2828 it ( "must be done" , ( ) => {
0 commit comments