summaryrefslogtreecommitdiff
path: root/desktop/qa
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-01-27 17:39:10 +0530
committerpranavk <pranavk@collabora.co.uk>2017-01-30 12:14:56 +0000
commit8a7c459f6afb7b8f1f622a61230a0a4411a417ac (patch)
tree3e17f7c1ddd08ffcf0815996c9b9d16d9dca8480 /desktop/qa
parentd27aba549cdbcad6825ac6c955ee7d603aba1989 (diff)
lok: Allow to edit comment by postit id
Change-Id: Ice1d40b7813226fe99c423047392b3416d763dd4 Reviewed-on: https://gerrit.libreoffice.org/33614 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'desktop/qa')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index b53461fdb16a..a1a769b31da6 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -1938,6 +1938,20 @@ void DesktopLOKTest::testCommentsCallbacks()
CPPUNIT_ASSERT_EQUAL(std::string("Reply comment"), aView2.m_aCommentCallbackResult.get<std::string>("text"));
int nCommentId2 = aView1.m_aCommentCallbackResult.get<int>("id");
+ // Edit the previously added comment
+ aCommandArgs = "{ \"Id\": { \"type\": \"long\", \"value\": \"" + OString::number(nCommentId2) + "\" }, \"Text\": { \"type\": \"string\", \"value\": \"Edited comment\" } }";
+ pDocument->pClass->postUnoCommand(pDocument, ".uno:EditAnnotation", aCommandArgs.getStr(), false);
+ Scheduler::ProcessEventsToIdle();
+
+ // We received a LOK_CALLBACK_COMMENT callback with comment 'Modify' action
+ CPPUNIT_ASSERT_EQUAL(std::string("Modify"), aView1.m_aCommentCallbackResult.get<std::string>("action"));
+ CPPUNIT_ASSERT_EQUAL(std::string("Modify"), aView2.m_aCommentCallbackResult.get<std::string>("action"));
+ // parent is unchanged still
+ CPPUNIT_ASSERT_EQUAL(nCommentId1, aView1.m_aCommentCallbackResult.get<int>("parent"));
+ CPPUNIT_ASSERT_EQUAL(nCommentId1, aView2.m_aCommentCallbackResult.get<int>("parent"));
+ CPPUNIT_ASSERT_EQUAL(std::string("Edited comment"), aView1.m_aCommentCallbackResult.get<std::string>("text"));
+ CPPUNIT_ASSERT_EQUAL(std::string("Edited comment"), aView2.m_aCommentCallbackResult.get<std::string>("text"));
+
// Delete the reply comment just added
aCommandArgs = "{ \"Id\": { \"type\": \"long\", \"value\": \"" + OString::number(nCommentId2) + "\" } }";
pDocument->pClass->postUnoCommand(pDocument, ".uno:DeleteComment", aCommandArgs.getStr(), false);