Begin reimplementing compose
This commit is contained in:
@@ -219,12 +219,24 @@ class ComposeReactTests(TestCase):
|
||||
)
|
||||
mocked_send_reaction.assert_not_awaited()
|
||||
|
||||
def test_compose_page_renders_reaction_actions_for_signal(self):
|
||||
person, _, _ = self._build_message(
|
||||
def test_compose_page_hides_reaction_actions_for_signal_but_keeps_reaction_chips(
|
||||
self,
|
||||
):
|
||||
person, _, message = self._build_message(
|
||||
service="signal",
|
||||
identifier="+15551230000",
|
||||
source_message_id="1771234567000",
|
||||
)
|
||||
message.receipt_payload = {
|
||||
"reactions": [
|
||||
{
|
||||
"emoji": "👍",
|
||||
"actor": "remote:signal",
|
||||
"source_service": "signal",
|
||||
}
|
||||
]
|
||||
}
|
||||
message.save(update_fields=["receipt_payload"])
|
||||
response = self.client.get(
|
||||
reverse("compose_page"),
|
||||
{
|
||||
@@ -235,8 +247,10 @@ class ComposeReactTests(TestCase):
|
||||
)
|
||||
self.assertEqual(200, response.status_code)
|
||||
content = response.content.decode("utf-8")
|
||||
self.assertIn("data-react-url=", content)
|
||||
self.assertIn("compose-reaction-actions", content)
|
||||
self.assertNotIn("data-react-url=", content)
|
||||
self.assertNotIn("compose-reaction-actions", content)
|
||||
self.assertIn("compose-reaction-chip", content)
|
||||
self.assertIn("👍", content)
|
||||
|
||||
def test_compose_page_hides_reaction_actions_for_unsupported_service(self):
|
||||
person, _, _ = self._build_message(
|
||||
@@ -253,7 +267,9 @@ class ComposeReactTests(TestCase):
|
||||
},
|
||||
)
|
||||
self.assertEqual(200, response.status_code)
|
||||
content = response.content.decode("utf-8")
|
||||
self.assertNotIn("data-react-url=", content)
|
||||
self.assertNotIn(
|
||||
'class="compose-reaction-actions"',
|
||||
response.content.decode("utf-8"),
|
||||
content,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user