-
+
{getConfig().SCHEDULE_EMAIL_SECTION && (
@@ -26,7 +27,7 @@ function BulkEmailTaskManager({ intl }) {
{intl.formatMessage(messages.pendingTasksHeader)}
-
+
);
@@ -34,6 +35,7 @@ function BulkEmailTaskManager({ intl }) {
BulkEmailTaskManager.propTypes = {
intl: intlShape.isRequired,
+ courseId: PropTypes.string.isRequired,
};
export default injectIntl(BulkEmailTaskManager);
diff --git a/src/components/bulk-email-tool/bulk-email-task-manager/test/BulkEmailPendingTasksAlert.test.jsx b/src/components/bulk-email-tool/bulk-email-task-manager/test/BulkEmailPendingTasksAlert.test.jsx
new file mode 100644
index 0000000..50af805
--- /dev/null
+++ b/src/components/bulk-email-tool/bulk-email-task-manager/test/BulkEmailPendingTasksAlert.test.jsx
@@ -0,0 +1,33 @@
+import React from 'react';
+
+import BulkEmailPendingTasksAlert from '../BulkEmailPendingTasksAlert';
+import {
+ initializeMockApp, render, screen,
+} from '../../../../setupTest';
+
+describe('Testing BulkEmailPendingTasksAlert Component', () => {
+ beforeAll(async () => {
+ await initializeMockApp();
+ });
+
+ test('Render without Public path', async () => {
+ render();
+
+ const linkEl = await screen.findByText('Course Info');
+ expect(linkEl.href).toEqual('http://localhost:18000/courses/test-course-id/instructor#view-course-info');
+ });
+
+ test('Render with Public path', async () => {
+ Object.defineProperty(window, 'location', {
+ get() {
+ return { pathname: '/communications/courses/test-course-id/bulk-email' };
+ },
+ });
+
+ render();
+
+ const linkEl = await screen.findByText('Course Info');
+ expect(linkEl.href).toEqual('http://localhost:18000/courses/test-course-id/instructor#view-course-info');
+ expect(window.location.pathname).toEqual('/communications/courses/test-course-id/bulk-email');
+ });
+});
diff --git a/src/components/navigation-tabs/BackToInstructor.jsx b/src/components/navigation-tabs/BackToInstructor.jsx
index 2f0c6ce..2d5bd05 100644
--- a/src/components/navigation-tabs/BackToInstructor.jsx
+++ b/src/components/navigation-tabs/BackToInstructor.jsx
@@ -1,16 +1,19 @@
import React from 'react';
+import PropTypes from 'prop-types';
import { getConfig } from '@edx/frontend-platform';
import { FormattedMessage } from '@edx/frontend-platform/i18n';
import { Button, Icon } from '@edx/paragon';
import { ArrowBack } from '@edx/paragon/icons';
-export default function BackToInstructor() {
+export default function BackToInstructor(props) {
+ const { courseId } = props;
+
return (