UNPKG

@shopgate/pwa-common-commerce

Version:

Commerce library for the Shopgate Connect PWA.

1 lines 960 B
import errorReviews from"./errorReviews";import receiveReviews from"./receiveReviews";import requestReviews from"./requestReviews";import{ERROR_REVIEWS,RECEIVE_REVIEWS,REQUEST_REVIEWS}from"../constants/index";var hash='foo';var productId='1';describe('Reviews action-creators',function(){describe('errorReviews',function(){it('should return correct action',function(){var action=errorReviews(hash);expect(action).toEqual({type:ERROR_REVIEWS,hash:hash});});});describe('receiveReviews',function(){it('should return correct action',function(){var reviews=[];var totalReviewCount=20;var action=receiveReviews(hash,productId,reviews,totalReviewCount);expect(action).toEqual({type:RECEIVE_REVIEWS,hash:hash,productId:productId,reviews:reviews,totalReviewCount:totalReviewCount});});});describe('requestReviews',function(){it('should return correct action',function(){var action=requestReviews(hash);expect(action).toEqual({type:REQUEST_REVIEWS,hash:hash});});});});