mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 13:39:41 -04:00
Migrate two branding tests to utils module
This is much simpler than trying to test the function via the page, although there are still two scenarios to test there: - The page with radio buttons (using NHS as an example). - The page with a text form (using "other" as an example). In future work we could split this test in two to make it clearer what it's trying to test. For now, this keeps the diff simple.
This commit is contained in:
28
tests/app/utils/test_branding.py
Normal file
28
tests/app/utils/test_branding.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import pytest
|
||||
|
||||
from app.models.service import Service
|
||||
from app.utils.branding import get_available_choices
|
||||
|
||||
|
||||
@pytest.mark.parametrize('branding_type', ['email', 'letter'])
|
||||
@pytest.mark.parametrize('org_type, existing_branding, expected_options', [
|
||||
('central', None, []),
|
||||
('local', None, []),
|
||||
('nhs_central', None, [('nhs', 'NHS')]),
|
||||
('nhs_local', None, [('nhs', 'NHS')]),
|
||||
('nhs_gp', None, [('nhs', 'NHS')]),
|
||||
('emergency_service', None, []),
|
||||
('other', None, []),
|
||||
])
|
||||
def test_get_available_choices_no_org(
|
||||
service_one,
|
||||
branding_type,
|
||||
org_type,
|
||||
existing_branding,
|
||||
expected_options,
|
||||
):
|
||||
service_one['organisation_type'] = org_type
|
||||
service = Service(service_one)
|
||||
|
||||
options = get_available_choices(service, branding_type=branding_type)
|
||||
assert list(options) == expected_options
|
||||
Reference in New Issue
Block a user