test: Add test for past expiration messaging in gated content
This commit is contained in:
@@ -80,4 +80,18 @@ describe('Lock Paywall', () => {
|
||||
|
||||
expect(container).toBeEmptyDOMElement();
|
||||
});
|
||||
|
||||
it('displays past expiration message if expiration date has expired', async () => {
|
||||
const courseMetadata = Factory.build('courseMetadata', {
|
||||
access_expiration: {
|
||||
expiration_date: '1995-02-22T05:00:00Z',
|
||||
},
|
||||
marketing_url: 'https://example.com/course-details',
|
||||
});
|
||||
const testStore = await initializeTestStore({ courseMetadata }, false);
|
||||
render(<LockPaywall {...mockData} courseId={courseMetadata.id} />, { store: testStore });
|
||||
expect(screen.getByText('The upgrade deadline for this course passed. To upgrade, enroll in the next available session.')).toBeInTheDocument();
|
||||
expect(screen.getByText('View Course Details'))
|
||||
.toHaveAttribute('href', 'https://example.com/course-details');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6,6 +6,9 @@ Factory.define('courseMetadata')
|
||||
.extend(courseMetadataBase)
|
||||
.option('host', '')
|
||||
.attrs({
|
||||
access_expiration: {
|
||||
expiration_date: '2032-02-22T05:00:00Z',
|
||||
},
|
||||
content_type_gating_enabled: false,
|
||||
course_expired_message: null,
|
||||
course_goals: {
|
||||
|
||||
Reference in New Issue
Block a user