@@ -3,7 +3,6 @@ import { shallow } from '@edx/react-unit-test-utils';
3
3
import { reduxHooks } from 'hooks' ;
4
4
5
5
import CourseCardActionSlot from 'plugin-slots/CourseCardActionSlot' ;
6
- import UpgradeButton from './UpgradeButton' ;
7
6
import SelectSessionButton from './SelectSessionButton' ;
8
7
import BeginCourseButton from './BeginCourseButton' ;
9
8
import ResumeButton from './ResumeButton' ;
@@ -21,7 +20,6 @@ jest.mock('hooks', () => ({
21
20
} ) ) ;
22
21
23
22
jest . mock ( 'plugin-slots/CourseCardActionSlot' , ( ) => 'CustomActionButton' ) ;
24
- jest . mock ( './UpgradeButton' , ( ) => 'UpgradeButton' ) ;
25
23
jest . mock ( './SelectSessionButton' , ( ) => 'SelectSessionButton' ) ;
26
24
jest . mock ( './ViewCourseButton' , ( ) => 'ViewCourseButton' ) ;
27
25
jest . mock ( './BeginCourseButton' , ( ) => 'BeginCourseButton' ) ;
@@ -59,19 +57,7 @@ describe('CourseCardActions', () => {
59
57
} ) ;
60
58
} ) ;
61
59
describe ( 'output' , ( ) => {
62
- describe ( 'Exec Ed course' , ( ) => {
63
- it ( 'does not render upgrade button' , ( ) => {
64
- mockHooks ( { isExecEd2UCourse : true } ) ;
65
- render ( ) ;
66
- expect ( el . instance . findByType ( UpgradeButton ) . length ) . toEqual ( 0 ) ;
67
- } ) ;
68
- } ) ;
69
60
describe ( 'entitlement course' , ( ) => {
70
- it ( 'does not render upgrade button' , ( ) => {
71
- mockHooks ( { isEntitlement : true } ) ;
72
- render ( ) ;
73
- expect ( el . instance . findByType ( UpgradeButton ) . length ) . toEqual ( 0 ) ;
74
- } ) ;
75
61
it ( 'renders ViewCourseButton if fulfilled' , ( ) => {
76
62
mockHooks ( { isEntitlement : true , isFulfilled : true } ) ;
77
63
render ( ) ;
@@ -83,30 +69,23 @@ describe('CourseCardActions', () => {
83
69
expect ( el . instance . findByType ( SelectSessionButton ) [ 0 ] . props . cardId ) . toEqual ( cardId ) ;
84
70
} ) ;
85
71
} ) ;
86
- describe ( 'verified course' , ( ) => {
87
- it ( 'does not render upgrade button' , ( ) => {
88
- mockHooks ( { isVerified : true } ) ;
89
- render ( ) ;
90
- expect ( el . instance . findByType ( UpgradeButton ) . length ) . toEqual ( 0 ) ;
91
- } ) ;
92
- } ) ;
93
72
describe ( 'not entitlement, verified, or exec ed' , ( ) => {
94
- it ( 'renders UpgradeButton and ViewCourseButton for archived courses' , ( ) => {
73
+ it ( 'renders CourseCardActionSlot and ViewCourseButton for archived courses' , ( ) => {
95
74
mockHooks ( { isArchived : true } ) ;
96
75
render ( ) ;
97
76
expect ( el . instance . findByType ( CourseCardActionSlot ) [ 0 ] . props . cardId ) . toEqual ( cardId ) ;
98
77
expect ( el . instance . findByType ( ViewCourseButton ) [ 0 ] . props . cardId ) . toEqual ( cardId ) ;
99
78
} ) ;
100
79
describe ( 'unstarted courses' , ( ) => {
101
- it ( 'renders UpgradeButton and BeginCourseButton' , ( ) => {
80
+ it ( 'renders CourseCardActionSlot and BeginCourseButton' , ( ) => {
102
81
mockHooks ( ) ;
103
82
render ( ) ;
104
83
expect ( el . instance . findByType ( CourseCardActionSlot ) [ 0 ] . props . cardId ) . toEqual ( cardId ) ;
105
84
expect ( el . instance . findByType ( BeginCourseButton ) [ 0 ] . props . cardId ) . toEqual ( cardId ) ;
106
85
} ) ;
107
86
} ) ;
108
87
describe ( 'active courses (started, and not archived)' , ( ) => {
109
- it ( 'renders UpgradeButton and ResumeButton' , ( ) => {
88
+ it ( 'renders CourseCardActionSlot and ResumeButton' , ( ) => {
110
89
mockHooks ( { hasStarted : true } ) ;
111
90
render ( ) ;
112
91
expect ( el . instance . findByType ( CourseCardActionSlot ) [ 0 ] . props . cardId ) . toEqual ( cardId ) ;
0 commit comments