File tree Expand file tree Collapse file tree
src/schedule-and-details/data Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { reducer , updateCourseDetailsOverview } from './slice' ;
2+
3+ describe ( 'scheduleAndDetails slice' , ( ) => {
4+ it ( 'should update courseDetails.overview when updateCourseDetailsOverview is dispatched' , ( ) => {
5+ const prevState = {
6+ loadingDetailsStatus : 'IN_PROGRESS' ,
7+ loadingSettingsStatus : 'IN_PROGRESS' ,
8+ savingStatus : '' ,
9+ courseDetails : {
10+ title : 'Intro to Testing' ,
11+ overview : 'Old overview' ,
12+ } ,
13+ courseSettings : { } ,
14+ } ;
15+
16+ const newOverview = '<p>New overview HTML content</p>' ;
17+
18+ const nextState = reducer ( prevState , updateCourseDetailsOverview ( newOverview ) ) ;
19+
20+ expect ( nextState . courseDetails . overview ) . toEqual ( newOverview ) ;
21+ expect ( nextState . courseDetails . title ) . toEqual ( 'Intro to Testing' ) ;
22+ } ) ;
23+ } ) ;
You can’t perform that action at this time.
0 commit comments