mirror of https://github.com/zulip/zulip.git
Add some message editing tests for invalid input.
This commit is contained in:
parent
211a166abc
commit
0d418d5695
|
@ -750,6 +750,25 @@ class EditMessageTest(AuthedTestCase):
|
|||
self.assert_json_success(result)
|
||||
self.check_message(msg_id, subject="edited")
|
||||
|
||||
def test_edit_message_no_changes(self):
|
||||
self.login("hamlet@zulip.com")
|
||||
msg_id = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM,
|
||||
subject="editing", content="before edit")
|
||||
result = self.client.post("/json/update_message", {
|
||||
'message_id': msg_id,
|
||||
})
|
||||
self.assert_json_error(result, "Nothing to change")
|
||||
|
||||
def test_edit_message_no_topic(self):
|
||||
self.login("hamlet@zulip.com")
|
||||
msg_id = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM,
|
||||
subject="editing", content="before edit")
|
||||
result = self.client.post("/json/update_message", {
|
||||
'message_id': msg_id,
|
||||
'subject': ' '
|
||||
})
|
||||
self.assert_json_error(result, "Topic can't be empty")
|
||||
|
||||
def test_propagate_topic_forward(self):
|
||||
self.login("hamlet@zulip.com")
|
||||
id1 = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM,
|
||||
|
|
Loading…
Reference in New Issue