-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENT-7512: LearnerCreditAllocationTable course title (#1025)
* chore: courseTitle link in LCM only if learner portal enabled
- Loading branch information
1 parent
ef1692d
commit 5a629a5
Showing
5 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ describe('<LearnerCreditAllocationTable />', () => { | |
isLoading: false, | ||
budgetType: 'OCM', | ||
enterpriseSlug: 'test-enterprise-slug', | ||
enableLearnerPortal: true, | ||
tableData: { | ||
results: [{ | ||
userEmail: '[email protected]', | ||
|
@@ -77,6 +78,7 @@ describe('<LearnerCreditAllocationTable />', () => { | |
isLoading: false, | ||
budgetType: 'OCM', | ||
enterpriseSlug: 'test-enterprise-slug', | ||
enableLearnerPortal: true, | ||
tableData: { | ||
results: [{ | ||
userEmail: '[email protected]', | ||
|
@@ -100,4 +102,32 @@ describe('<LearnerCreditAllocationTable />', () => { | |
|
||
expect(courseLinkElement.getAttribute('href')).toBe(expectedLink); | ||
}); | ||
|
||
it('does not render the course link if the learner portal is disabled', () => { | ||
const props = { | ||
enterpriseUUID: 'test-enterprise-id', | ||
isLoading: false, | ||
budgetType: 'OCM', | ||
enterpriseSlug: 'test-enterprise-slug', | ||
enableLearnerPortal: false, | ||
tableData: { | ||
results: [{ | ||
userEmail: '[email protected]', | ||
courseTitle: 'course-title', | ||
courseKey: 'course-v1:edX=CTL.SC101x.3T2019', | ||
courseListPrice: 100, | ||
enrollmentDate: '2-2-23', | ||
courseProductLine: 'OCM', | ||
}], | ||
itemCount: 1, | ||
pageCount: 1, | ||
}, | ||
fetchTableData: jest.fn(), | ||
}; | ||
props.fetchTableData.mockReturnValue(props.tableData); | ||
|
||
render(<LearnerCreditAllocationTableWrapper {...props} />); | ||
const courseTitleElement = screen.queryByText('course-title'); | ||
expect(courseTitleElement.closest('a')).toBeNull(); | ||
}); | ||
}); |