@shopgate/pwa-common
Version:
Common library for the Shopgate Connect PWA.
1 lines • 912 B
JavaScript
import{REQUEST_PAGE_CONFIG,RECEIVE_PAGE_CONFIG,ERROR_PAGE_CONFIG}from"../../constants/ActionTypes";import{requestPageConfig,receivePageConfig,errorPageConfig}from"./index";var pageId='index';var config={some:'data'};describe('Action Creators: page',function(){describe('requestPageConfig()',function(){it('should work as expected',function(){var expected={type:REQUEST_PAGE_CONFIG,pageId:pageId};expect(requestPageConfig(pageId)).toEqual(expected);});});describe('receivePageConfig()',function(){it('should work as expected',function(){var expected={type:RECEIVE_PAGE_CONFIG,pageId:pageId,config:config};expect(receivePageConfig(pageId,config)).toEqual(expected);});});describe('errorPageConfig()',function(){it('should work as expected',function(){var errorCode='error';var expected={type:ERROR_PAGE_CONFIG,errorCode:errorCode,pageId:pageId};expect(errorPageConfig(pageId,errorCode)).toEqual(expected);});});});