-
Notifications
You must be signed in to change notification settings - Fork 160
chore: Refactor proctoring provider handling in Settings #2494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
santhosh-apphelix-2u
wants to merge
9
commits into
openedx:master
Choose a base branch
from
santhosh-apphelix-2u:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+7
−48
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
be94bcd
chore: Refactor proctoring provider handling in Settings
santhosh-apphelix-2u 6f8a9e6
Merge branch 'openedx:master' into master
santhosh-apphelix-2u da94636
chore: Skip Zendesk ticket tests for deprecated provider
santhosh-apphelix-2u fd78dd6
chore: Skip proctortrack related tests in Settings.test.jsx
santhosh-apphelix-2u 19a279e
chore: Skip tests for Proctortrack deprecation
santhosh-apphelix-2u e1f198c
chore: Skip alert test for invalid proctoring escalation email
santhosh-apphelix-2u be50450
chore: Update test to select escalation email by display value
santhosh-apphelix-2u 9942e16
chore: Remove deprecated Proctortrack tests from Settings.test.jsx
santhosh-apphelix-2u e828d95
Merge branch 'openedx:master' into master
santhosh-apphelix-2u File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,16 +105,6 @@ describe('ProctoredExamSettings', () => { | |
await act(async () => render(intlWrapper(<IntlProctoredExamSettings {...defaultProps} />))); | ||
}); | ||
|
||
it('Updates Zendesk ticket field if proctortrack is provider', async () => { | ||
await waitFor(() => { | ||
screen.getByDisplayValue('mockproc'); | ||
}); | ||
const selectElement = screen.getByDisplayValue('mockproc'); | ||
fireEvent.change(selectElement, { target: { value: 'proctortrack' } }); | ||
const zendeskTicketInput = screen.getByTestId('createZendeskTicketsNo'); | ||
expect(zendeskTicketInput.checked).toEqual(true); | ||
}); | ||
|
||
it('Updates Zendesk ticket field if software_secure is provider', async () => { | ||
await waitFor(() => { | ||
screen.getByDisplayValue('mockproc'); | ||
|
@@ -250,7 +240,8 @@ describe('ProctoredExamSettings', () => { | |
expect(document.activeElement).toEqual(escalationEmailInput); | ||
}); | ||
|
||
it(`Creates an alert when invalid proctoring escalation email is provided with ${provider} selected`, async () => { | ||
// Test skipped due to Proctortrack deprecation | ||
it.skip(`Creates an alert when invalid proctoring escalation email is provided with ${provider} selected`, async () => { | ||
await waitFor(() => { | ||
screen.getByDisplayValue('proctortrack'); | ||
}); | ||
|
@@ -349,7 +340,8 @@ describe('ProctoredExamSettings', () => { | |
expect(screen.queryByTestId('escalationEmail')).toBeNull(); | ||
}); | ||
|
||
it(`Escalation email Field Show when proctoring backend is switched back to ${provider}`, async () => { | ||
// Test skipped due to Proctortrack deprecation | ||
it.skip(`Escalation email Field Show when proctoring backend is switched back to ${provider}`, async () => { | ||
await waitFor(() => { | ||
screen.getByDisplayValue('proctortrack'); | ||
}); | ||
|
@@ -606,37 +598,6 @@ describe('ProctoredExamSettings', () => { | |
expect(submitButton).toHaveAttribute('disabled'); | ||
}); | ||
|
||
it('Makes API call successfully with proctoring_escalation_email if proctortrack', async () => { | ||
await act(async () => render(intlWrapper(<IntlProctoredExamSettings {...defaultProps} />))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we disabling this test now? |
||
// Make a change to the provider to proctortrack and set the email | ||
const selectElement = screen.getByDisplayValue('mockproc'); | ||
fireEvent.change(selectElement, { target: { value: 'proctortrack' } }); | ||
const escalationEmail = screen.getByTestId('escalationEmail'); | ||
expect(escalationEmail.value).toEqual('test@example.com'); | ||
fireEvent.change(escalationEmail, { target: { value: 'proctortrack@example.com' } }); | ||
expect(escalationEmail.value).toEqual('proctortrack@example.com'); | ||
const submitButton = screen.getByTestId('submissionButton'); | ||
fireEvent.click(submitButton); | ||
expect(axiosMock.history.post.length).toBe(1); | ||
expect(JSON.parse(axiosMock.history.post[0].data)).toEqual({ | ||
proctored_exam_settings: { | ||
enable_proctored_exams: true, | ||
allow_proctoring_opt_out: false, | ||
proctoring_provider: 'proctortrack', | ||
proctoring_escalation_email: 'proctortrack@example.com', | ||
create_zendesk_tickets: false, | ||
}, | ||
}); | ||
|
||
await waitFor(() => { | ||
const errorAlert = screen.getByTestId('saveSuccess'); | ||
expect(errorAlert.textContent).toEqual( | ||
expect.stringContaining('Proctored exam settings saved successfully.'), | ||
); | ||
expect(document.activeElement).toEqual(errorAlert); | ||
}); | ||
}); | ||
|
||
it('Makes API call successfully without proctoring_escalation_email if not proctortrack', async () => { | ||
await act(async () => render(intlWrapper(<IntlProctoredExamSettings {...defaultProps} />))); | ||
|
||
|
@@ -863,7 +824,8 @@ describe('ProctoredExamSettings', () => { | |
}); | ||
}); | ||
|
||
it('Include Zendesk ticket in post request if user is not an admin', async () => { | ||
// Test skipped due to Proctortrack deprecation | ||
it.skip('Include Zendesk ticket in post request if user is not an admin', async () => { | ||
// use non-admin user for test | ||
const isAdmin = false; | ||
setupApp(isAdmin); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we disabling this test?