-
-
-
-
- {masquerade}
-
-
- {this.getOptions()}
-
-
-
- {shouldShowUserNameInput && (
-
- {`${specificLearnerInputText}:`}
- this.onError(errorMessage)}
- onSubmit={(payload) => this.onSubmit(payload)}
- />
-
- )}
-
- );
- }
-}
-MasqueradeWidget.propTypes = {
- courseId: PropTypes.string.isRequired,
- intl: intlShape.isRequired,
- onError: PropTypes.func.isRequired,
-};
-MasqueradeWidget.contextType = UserMessagesContext;
-export default injectIntl(MasqueradeWidget);
diff --git a/src/instructor-toolbar/masquerade-widget/MasqueradeWidget.test.jsx b/src/instructor-toolbar/masquerade-widget/MasqueradeWidget.test.jsx
deleted file mode 100644
index 7349858a37..0000000000
--- a/src/instructor-toolbar/masquerade-widget/MasqueradeWidget.test.jsx
+++ /dev/null
@@ -1,137 +0,0 @@
-import React from 'react';
-import { getAllByRole } from '@testing-library/dom';
-import { act } from '@testing-library/react';
-import { getConfig } from '@edx/frontend-platform';
-import MockAdapter from 'axios-mock-adapter';
-import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
-import MasqueradeWidget from './MasqueradeWidget';
-import {
- render, screen, fireEvent, initializeTestStore, waitFor, logUnhandledRequests,
-} from '../../setupTest';
-
-const originalConfig = jest.requireActual('@edx/frontend-platform').getConfig();
-jest.mock('@edx/frontend-platform', () => ({
- ...jest.requireActual('@edx/frontend-platform'),
- getConfig: jest.fn(),
-}));
-getConfig.mockImplementation(() => originalConfig);
-
-describe('Masquerade Widget Dropdown', () => {
- let mockData;
- let courseware;
- let mockResponse;
- let axiosMock;
- let masqueradeUrl;
- const masqueradeOptions = [
- {
- name: 'Staff',
- role: 'staff',
- },
- {
- name: 'Specific Student...',
- role: 'student',
- user_name: '',
- },
- {
- group_id: 1,
- name: 'Audit',
- role: 'student',
- user_partition_id: 50,
- },
- ];
-
- beforeAll(async () => {
- const store = await initializeTestStore();
- courseware = store.getState().courseware;
- axiosMock = new MockAdapter(getAuthenticatedHttpClient());
- masqueradeUrl = `${getConfig().LMS_BASE_URL}/courses/${courseware.courseId}/masquerade`;
- mockData = {
- courseId: courseware.courseId,
- onError: () => {},
- };
- });
-
- beforeEach(() => {
- mockResponse = {
- success: true,
- active: {
- course_key: courseware.courseId,
- group_id: null,
- role: 'staff',
- user_name: null,
- user_partition_id: null,
- group_name: null,
- },
- available: masqueradeOptions,
- };
- axiosMock.reset();
- axiosMock.onGet(masqueradeUrl).reply(200, mockResponse);
- logUnhandledRequests(axiosMock);
- });
-
- it('renders masquerade name correctly', async () => {
- render(