mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 13:39:41 -04:00
Add character count as you type
Text messages have a maximum length, which we tell the users. We
shouldn’t expect people to count the characters in the message
themselves.
This commit borrows [the word counter from the Digital Marketplace
frontend toolkit](9d17690de5/toolkit/javascripts/word-counter.js)
and adapts it to count characters instead.
Things I’m still not sure about with this:
- what should it say when the message goes over the length of one text
message
- what’s the interaction with placeholders, which will change the length
of the message
This commit also adds a line to the pricing page which explains that
service name counts towards the length of the message.
This commit is contained in:
@@ -29,10 +29,14 @@ def test_should_show_page_for_one_templates(app_,
|
||||
template_id=template_id))
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Two week reminder" in response.get_data(as_text=True)
|
||||
assert "Your vehicle tax is about to expire" in response.get_data(as_text=True)
|
||||
content = response.get_data(as_text=True)
|
||||
assert "Two week reminder" in content
|
||||
assert "Your vehicle tax is about to expire" in content
|
||||
assert 'data-module="character-count"' in content
|
||||
assert 'data-service-name="Test Service"' in content
|
||||
mock_get_service_template.assert_called_with(
|
||||
service_id, template_id)
|
||||
service_id, template_id
|
||||
)
|
||||
|
||||
|
||||
def test_should_redirect_when_saving_a_template(app_,
|
||||
|
||||
Reference in New Issue
Block a user