-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional zoom account fixes (#401)
* Remove Zoom as a meeting link provider if they disconnect their zoom account * Hide the video link text field if they want zoom meeting links generated
- Loading branch information
1 parent
4ae6783
commit 65bda8c
Showing
4 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
|
||
from appointment.database import models | ||
from defines import auth_headers, TEST_USER_ID | ||
|
||
|
||
class TestZoom: | ||
def test_zoom_disconnect_without_connection(self, with_client): | ||
response = with_client.post( | ||
"/zoom/disconnect", | ||
headers=auth_headers) | ||
assert response.status_code == 200 | ||
assert response.json() is False | ||
|
||
def test_zoom_disconnect_with_connection(self, with_client, make_external_connections): | ||
make_external_connections(TEST_USER_ID, type=models.ExternalConnectionType.zoom) | ||
|
||
response = with_client.post( | ||
"/zoom/disconnect", | ||
headers=auth_headers) | ||
assert response.status_code == 200 | ||
assert response.json() is True | ||
|
||
def test_zoom_disconnect_updates_schedule(self, with_db, with_client, make_schedule, make_external_connections): | ||
make_external_connections(TEST_USER_ID, type=models.ExternalConnectionType.zoom) | ||
schedule = make_schedule(meeting_link_provider=models.MeetingLinkProviderType.zoom) | ||
|
||
assert schedule.meeting_link_provider == models.MeetingLinkProviderType.zoom | ||
|
||
response = with_client.post( | ||
"/zoom/disconnect", | ||
headers=auth_headers) | ||
assert response.status_code == 200 | ||
assert response.json() is True | ||
|
||
# Refresh the schedule now that the zoom account is gone, | ||
# and our meeting link provider should be none | ||
with with_db() as db: | ||
db.add(schedule) | ||
db.refresh(schedule) | ||
|
||
assert schedule.meeting_link_provider == models.MeetingLinkProviderType.none | ||
|
||
def test_zoom_disconnect_does_not_update_schedule_for_other_types(self, with_db, with_client, make_schedule, | ||
make_external_connections): | ||
make_external_connections(TEST_USER_ID, type=models.ExternalConnectionType.zoom) | ||
schedule = make_schedule(meeting_link_provider=models.MeetingLinkProviderType.google_meet) | ||
|
||
assert schedule.meeting_link_provider == models.MeetingLinkProviderType.google_meet | ||
|
||
response = with_client.post( | ||
"/zoom/disconnect", | ||
headers=auth_headers) | ||
assert response.status_code == 200 | ||
assert response.json() is True | ||
|
||
# Refresh the schedule now that the zoom account is gone, | ||
# and our meeting link provider should still be google meet | ||
with with_db() as db: | ||
db.add(schedule) | ||
db.refresh(schedule) | ||
|
||
assert schedule.meeting_link_provider == models.MeetingLinkProviderType.google_meet |
This file contains 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