Skip to content

Commit

Permalink
Merge pull request #1381 from glogiotatidis/entrypoint-fix
Browse files Browse the repository at this point in the history
[Issue #1380] Fix JSON key name for button entrypoint.
  • Loading branch information
glogiotatidis committed May 19, 2020
2 parents 356b2a5 + fdecffb commit 7fa4e95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snippets/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,9 @@ def _convert_special_buttons(self, data):
if args:
to_append['button_action_args'] = args
if entrypoint_name:
to_append['entrypoint_name'] = entrypoint_name
to_append['button_entrypoint_name'] = entrypoint_name
if entrypoint_value:
to_append['entrypoint_value'] = entrypoint_value
to_append['button_entrypoint_value'] = entrypoint_value

for key in to_delete:
local_data.pop(key)
Expand Down
5 changes: 5 additions & 0 deletions snippets/base/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,15 @@ def test_process_rendered_data(self):
data = {
'foo': '',
'bar': 'bar',
'button_url': 'special:about:logins'
}
expected_data = {
'bar': 'bar',
'links': {},
'button_action': 'OPEN_ABOUT_PAGE',
'button_action_args': 'logins',
'button_entrypoint_name': 'entryPoint',
'button_entrypoint_value': 'snippet',
}
snippet = ASRSnippetFactory()
with patch('snippets.base.models.util.fluent_link_extractor',
Expand Down

0 comments on commit 7fa4e95

Please sign in to comment.