Use prereqSectionName for the name of the prereq section. (#284)

Surprise, surprise.

Not sure how this wasn’t correct.  The bug results in the content lock UI showing the name of the current section rather than the prerequisite when describing… the prerequisite.
This commit is contained in:
David Joy
2020-12-01 10:04:59 -05:00
committed by GitHub
parent 3f9f40800a
commit 1bfe3f4436
2 changed files with 2 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ function SequenceContent({
<ContentLock
courseId={courseId}
sequenceTitle={sequence.title}
prereqSectionName={sequence.gatedContent.gatedSectionName}
prereqSectionName={sequence.gatedContent.prereqSectionName}
prereqId={sequence.gatedContent.prereqId}
/>
</Suspense>

View File

@@ -32,7 +32,7 @@ describe('Sequence Content', () => {
expect(screen.queryByText('Loading locked content messaging...')).not.toBeInTheDocument();
expect(container.querySelector('svg')).toHaveClass('fa-lock');
expect(screen.getByText(
`You must complete the prerequisite: '${gatedContent.gatedSectionName}' to access this content.`,
`You must complete the prerequisite: '${gatedContent.prereqSectionName}' to access this content.`,
)).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Go To Prerequisite Section' })).toBeInTheDocument();
});