chore: update edx frontend packages (#35)
This commit is contained in:
39472
package-lock.json
generated
39472
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -38,8 +38,8 @@
|
||||
"@edx/brand": "npm:@edx/brand-openedx@1.1.0",
|
||||
"@edx/frontend-component-footer": "10.1.6",
|
||||
"@edx/frontend-component-header": "^2.4.2",
|
||||
"@edx/frontend-platform": "1.12.7",
|
||||
"@edx/paragon": "16.3.2",
|
||||
"@edx/frontend-platform": "1.15.6",
|
||||
"@edx/paragon": "19.18.3",
|
||||
"@edx/tinymce-language-selector": "^1.1.0",
|
||||
"@fortawesome/fontawesome-svg-core": "1.2.36",
|
||||
"@fortawesome/free-brands-svg-icons": "5.15.4",
|
||||
@@ -60,7 +60,7 @@
|
||||
"tinymce": "^5.10.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@edx/frontend-build": "8.1.6",
|
||||
"@edx/frontend-build": "9.1.4",
|
||||
"axios-mock-adapter": "^1.20.0",
|
||||
"codecov": "3.8.3",
|
||||
"es-check": "6.1.1",
|
||||
|
||||
@@ -11,7 +11,7 @@ import messages from './messages';
|
||||
import { getSentEmailHistory } from './data/api';
|
||||
import BulkEmailTaskManagerTable from './BulkEmailHistoryTable';
|
||||
|
||||
export function BulkEmailContentHistory({ intl, copyTextToEditor }) {
|
||||
function BulkEmailContentHistory({ intl, copyTextToEditor }) {
|
||||
const { courseId } = useParams();
|
||||
const BUTTON_STATE = {
|
||||
DEFAULT: 'default',
|
||||
|
||||
@@ -7,7 +7,7 @@ import messages from './messages';
|
||||
import useInterval from '../../../utils/useInterval';
|
||||
import BulkEmailTaskManagerTable from './BulkEmailHistoryTable';
|
||||
|
||||
export function BulkEmailPendingTasks({ intl }) {
|
||||
function BulkEmailPendingTasks({ intl }) {
|
||||
const { courseId } = useParams();
|
||||
|
||||
const [instructorTaskData, setInstructorTaskData] = useState();
|
||||
|
||||
@@ -9,7 +9,7 @@ import messages from './messages';
|
||||
|
||||
import BulkEmailTaskManagerTable from './BulkEmailHistoryTable';
|
||||
|
||||
export function BulkEmailTaskHistory({ intl }) {
|
||||
function BulkEmailTaskHistory({ intl }) {
|
||||
const { courseId } = useParams();
|
||||
const BUTTON_STATE = {
|
||||
DEFAULT: 'default',
|
||||
|
||||
@@ -7,7 +7,7 @@ import BulkEmailPendingTasks from './BulkEmailPendingTasks';
|
||||
import BulkEmailTaskHistory from './BulkEmailTaskHistory';
|
||||
import messages from './messages';
|
||||
|
||||
export function BulkEmailTaskManager({ intl, copyTextToEditor }) {
|
||||
function BulkEmailTaskManager({ intl, copyTextToEditor }) {
|
||||
return (
|
||||
<div className="px-5">
|
||||
<div>
|
||||
|
||||
@@ -27,68 +27,72 @@ describe('BulkEmailPendingTasks component', () => {
|
||||
});
|
||||
|
||||
test('renders a table when running Instructor Task data is returned', async () => {
|
||||
await act(async () => {
|
||||
jest.useFakeTimers();
|
||||
jest.useFakeTimers();
|
||||
|
||||
const pendingInstructorTaskData = buildPendingInstructorTaskData(1);
|
||||
getInstructorTasks.mockImplementation(() => pendingInstructorTaskData);
|
||||
const pendingInstructorTaskData = buildPendingInstructorTaskData(1);
|
||||
getInstructorTasks.mockImplementation(() => pendingInstructorTaskData);
|
||||
|
||||
act(() => {
|
||||
render(<BulkEmailPendingTasks />);
|
||||
});
|
||||
|
||||
act(() => {
|
||||
// fast forward time by 31 seconds for the API call to be made to retrieve pending tasks
|
||||
jest.advanceTimersByTime(31000);
|
||||
|
||||
// verify component structure
|
||||
const tableDescription = await screen.findByText(
|
||||
'Email actions run in the background. The status for any active tasks - including email tasks - appears in '
|
||||
+ 'the table below.',
|
||||
);
|
||||
expect(tableDescription).toBeTruthy();
|
||||
|
||||
// verify table structure
|
||||
expect(await screen.findByText('Task Type')).toBeTruthy();
|
||||
expect(await screen.findByText('Task Inputs')).toBeTruthy();
|
||||
expect(await screen.findByText('Task Id')).toBeTruthy();
|
||||
expect(await screen.findByText('Requester')).toBeTruthy();
|
||||
expect(await screen.findByText('Submitted')).toBeTruthy();
|
||||
expect(await screen.findByText('Duration (seconds)')).toBeTruthy();
|
||||
expect(await screen.findByText('State')).toBeTruthy();
|
||||
expect(await screen.findByText('Status')).toBeTruthy();
|
||||
expect(await screen.findByText('Task Progress')).toBeTruthy();
|
||||
expect(await screen.findAllByText('Showing 1 of 1')).toBeTruthy();
|
||||
|
||||
// verification of table contents
|
||||
const { tasks } = pendingInstructorTaskData;
|
||||
const task = tasks[0];
|
||||
expect(await screen.findByText(task.created)).toBeTruthy();
|
||||
expect(await screen.findByText(task.duration_sec)).toBeTruthy();
|
||||
expect(await screen.findByText(task.requester)).toBeTruthy();
|
||||
expect(await screen.findByText(task.status)).toBeTruthy();
|
||||
expect(await screen.findByText(task.task_id)).toBeTruthy();
|
||||
expect(await screen.findByText(task.task_input)).toBeTruthy();
|
||||
expect(await screen.findByText(task.task_message)).toBeTruthy();
|
||||
expect(await screen.findByText(task.task_state)).toBeTruthy();
|
||||
expect(await screen.findByText(task.task_type)).toBeTruthy();
|
||||
});
|
||||
|
||||
// verify component structure
|
||||
const tableDescription = await screen.findByText(
|
||||
'Email actions run in the background. The status for any active tasks - including email tasks - appears in '
|
||||
+ 'the table below.',
|
||||
);
|
||||
expect(tableDescription).toBeTruthy();
|
||||
|
||||
// verify table structure
|
||||
expect(await screen.findByText('Task Type')).toBeTruthy();
|
||||
expect(await screen.findByText('Task Inputs')).toBeTruthy();
|
||||
expect(await screen.findByText('Task Id')).toBeTruthy();
|
||||
expect(await screen.findByText('Requester')).toBeTruthy();
|
||||
expect(await screen.findByText('Submitted')).toBeTruthy();
|
||||
expect(await screen.findByText('Duration (seconds)')).toBeTruthy();
|
||||
expect(await screen.findByText('State')).toBeTruthy();
|
||||
expect(await screen.findByText('Status')).toBeTruthy();
|
||||
expect(await screen.findByText('Task Progress')).toBeTruthy();
|
||||
expect(await screen.findAllByText('Showing 1 of 1.')).toBeTruthy();
|
||||
|
||||
// verification of table contents
|
||||
const { tasks } = pendingInstructorTaskData;
|
||||
const task = tasks[0];
|
||||
expect(await screen.findByText(task.created)).toBeTruthy();
|
||||
expect(await screen.findByText(task.duration_sec)).toBeTruthy();
|
||||
expect(await screen.findByText(task.requester)).toBeTruthy();
|
||||
expect(await screen.findByText(task.status)).toBeTruthy();
|
||||
expect(await screen.findByText(task.task_id)).toBeTruthy();
|
||||
expect(await screen.findByText(task.task_input)).toBeTruthy();
|
||||
expect(await screen.findByText(task.task_message)).toBeTruthy();
|
||||
expect(await screen.findByText(task.task_state)).toBeTruthy();
|
||||
expect(await screen.findByText(task.task_type)).toBeTruthy();
|
||||
});
|
||||
|
||||
test('renders an error Alert if an error occurs retrieving data', async () => {
|
||||
await act(async () => {
|
||||
jest.useFakeTimers();
|
||||
jest.useFakeTimers();
|
||||
|
||||
getInstructorTasks.mockImplementation(() => {
|
||||
throw new Error();
|
||||
});
|
||||
getInstructorTasks.mockImplementation(() => {
|
||||
throw new Error();
|
||||
});
|
||||
|
||||
act(() => {
|
||||
render(<BulkEmailPendingTasks />);
|
||||
});
|
||||
|
||||
act(() => {
|
||||
// fast forward time by 31 seconds for the API call to be made to retrieve pending tasks
|
||||
jest.advanceTimersByTime(31000);
|
||||
|
||||
const alertMessage = await screen.findByText(
|
||||
'Error fetching running task data. This request will be retried automatically.',
|
||||
);
|
||||
expect(alertMessage).toBeTruthy();
|
||||
});
|
||||
|
||||
const alertMessage = await screen.findByText(
|
||||
'Error fetching running task data. This request will be retried automatically.',
|
||||
);
|
||||
expect(alertMessage).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -48,7 +48,7 @@ describe('BulkEmailTaskHistory component', () => {
|
||||
expect(await screen.findByText('State')).toBeTruthy();
|
||||
expect(await screen.findByText('Status')).toBeTruthy();
|
||||
expect(await screen.findByText('Task Progress')).toBeTruthy();
|
||||
expect(await screen.findAllByText('Showing 1 of 1')).toBeTruthy();
|
||||
expect(await screen.findAllByText('Showing 1 of 1.')).toBeTruthy();
|
||||
// verification of row contents
|
||||
const { tasks } = taskHistoryData;
|
||||
const task = tasks[0];
|
||||
|
||||
Reference in New Issue
Block a user