File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { ownerMessageReducer } from "../ownerMessageReducer" ;
2+ import * as types from "../../constants/ownerMessageConstants" ;
3+
4+ describe ( "ownerMessageReducer" , ( ) => {
5+ const initialState = {
6+ message : '' ,
7+ standardMessage : '' ,
8+ } ;
9+
10+ it ( "should return the initial state when no action is provided" , ( ) => {
11+ expect ( ownerMessageReducer ( undefined , { } ) ) . toEqual ( initialState ) ;
12+ } ) ;
13+
14+ it ( "should handle UPDATE_OWNER_MESSAGE" , ( ) => {
15+ const action = {
16+ type : types . UPDATE_OWNER_MESSAGE ,
17+ payload : {
18+ message : "Updated owner message" ,
19+ standardMessage : "This is the standard message" ,
20+ } ,
21+ } ;
22+
23+ const expectedState = {
24+ message : "Updated owner message" ,
25+ standardMessage : "This is the standard message" ,
26+ } ;
27+
28+ expect ( ownerMessageReducer ( initialState , action ) ) . toEqual ( expectedState ) ;
29+ } ) ;
30+
31+ it ( "should return the current state for an unknown action type" , ( ) => {
32+ const unknownAction = {
33+ type : "UNKNOWN_ACTION" ,
34+ } ;
35+
36+ expect ( ownerMessageReducer ( initialState , unknownAction ) ) . toEqual ( initialState ) ;
37+ } ) ;
38+ } ) ;
You can’t perform that action at this time.
0 commit comments