@@ -2,6 +2,7 @@ import { shallow } from '@edx/react-unit-test-utils';
22
33import { reduxHooks } from 'hooks' ;
44
5+ import CourseCardActionSlot from 'plugin-slots/CourseCardActionSlot' ;
56import UpgradeButton from './UpgradeButton' ;
67import SelectSessionButton from './SelectSessionButton' ;
78import BeginCourseButton from './BeginCourseButton' ;
@@ -19,6 +20,7 @@ jest.mock('hooks', () => ({
1920 } ,
2021} ) ) ;
2122
23+ jest . mock ( 'plugin-slots/CourseCardActionSlot' , ( ) => 'CustomActionButton' ) ;
2224jest . mock ( './UpgradeButton' , ( ) => 'UpgradeButton' ) ;
2325jest . mock ( './SelectSessionButton' , ( ) => 'SelectSessionButton' ) ;
2426jest . mock ( './ViewCourseButton' , ( ) => 'ViewCourseButton' ) ;
@@ -88,26 +90,26 @@ describe('CourseCardActions', () => {
8890 expect ( el . instance . findByType ( UpgradeButton ) . length ) . toEqual ( 0 ) ;
8991 } ) ;
9092 } ) ;
91- describe ( 'not entielement , verified, or exec ed' , ( ) => {
93+ describe ( 'not entitlement , verified, or exec ed' , ( ) => {
9294 it ( 'renders UpgradeButton and ViewCourseButton for archived courses' , ( ) => {
9395 mockHooks ( { isArchived : true } ) ;
9496 render ( ) ;
95- expect ( el . instance . findByType ( UpgradeButton ) [ 0 ] . props . cardId ) . toEqual ( cardId ) ;
97+ expect ( el . instance . findByType ( CourseCardActionSlot ) [ 0 ] . props . cardId ) . toEqual ( cardId ) ;
9698 expect ( el . instance . findByType ( ViewCourseButton ) [ 0 ] . props . cardId ) . toEqual ( cardId ) ;
9799 } ) ;
98100 describe ( 'unstarted courses' , ( ) => {
99101 it ( 'renders UpgradeButton and BeginCourseButton' , ( ) => {
100102 mockHooks ( ) ;
101103 render ( ) ;
102- expect ( el . instance . findByType ( UpgradeButton ) [ 0 ] . props . cardId ) . toEqual ( cardId ) ;
104+ expect ( el . instance . findByType ( CourseCardActionSlot ) [ 0 ] . props . cardId ) . toEqual ( cardId ) ;
103105 expect ( el . instance . findByType ( BeginCourseButton ) [ 0 ] . props . cardId ) . toEqual ( cardId ) ;
104106 } ) ;
105107 } ) ;
106108 describe ( 'active courses (started, and not archived)' , ( ) => {
107109 it ( 'renders UpgradeButton and ResumeButton' , ( ) => {
108110 mockHooks ( { hasStarted : true } ) ;
109111 render ( ) ;
110- expect ( el . instance . findByType ( UpgradeButton ) [ 0 ] . props . cardId ) . toEqual ( cardId ) ;
112+ expect ( el . instance . findByType ( CourseCardActionSlot ) [ 0 ] . props . cardId ) . toEqual ( cardId ) ;
111113 expect ( el . instance . findByType ( ResumeButton ) [ 0 ] . props . cardId ) . toEqual ( cardId ) ;
112114 } ) ;
113115 } ) ;
0 commit comments