mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Show letter branding preview when selecting a brand
This adds a preview pane which is visible when updating a letter brand. If JavaScript is enabled, the preview pane shows on the set-letter-branding page, and submitting the form saves updates the letter brand for a service immediately. If Javascript is not enabled, there is a separate 'Preview email branding' page which shows a preview of the brand and has a 'Save' button on it.
This commit is contained in:
@@ -102,3 +102,20 @@ def test_page_count_unpacks_from_json_response(
|
||||
|
||||
assert partial_call({'template_type': 'letter'}) == 99
|
||||
mock_template_preview.assert_called_once_with(*expected_template_preview_args)
|
||||
|
||||
|
||||
def test_from_example_template_makes_request(mocker):
|
||||
request_mock = mocker.patch('app.template_previews.requests.post')
|
||||
template = {}
|
||||
filename = 'geo'
|
||||
|
||||
TemplatePreview.from_example_template(template, filename)
|
||||
|
||||
request_mock.assert_called_once_with(
|
||||
'http://localhost:9999/preview.png',
|
||||
headers={'Authorization': 'Token my-secret-key'},
|
||||
json={'values': None,
|
||||
'template': template,
|
||||
'filename': filename,
|
||||
'letter_contact_block': None}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user