aboutsummaryrefslogtreecommitdiff
path: root/tests/indicator-test.cpp
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-03-06 16:19:41 -0600
committerTed Gould <ted@gould.cx>2015-03-06 16:19:41 -0600
commit4bef5575c83bd34e467c4aa043e9bec221354feb (patch)
tree0d3521be603a8db032411c1c089ece31f1e0c1c1 /tests/indicator-test.cpp
parentbb83669a1a1cdf3cc4949a13a6b6977b336cd178 (diff)
downloadayatana-indicator-messages-4bef5575c83bd34e467c4aa043e9bec221354feb.tar.gz
ayatana-indicator-messages-4bef5575c83bd34e467c4aa043e9bec221354feb.tar.bz2
ayatana-indicator-messages-4bef5575c83bd34e467c4aa043e9bec221354feb.zip
Bringing in AS mock and getting a base test of the root action going
Diffstat (limited to 'tests/indicator-test.cpp')
-rw-r--r--tests/indicator-test.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/indicator-test.cpp b/tests/indicator-test.cpp
index 1aef466..3a5ef6d 100644
--- a/tests/indicator-test.cpp
+++ b/tests/indicator-test.cpp
@@ -21,6 +21,7 @@
#include <gio/gio.h>
#include "indicator-fixture.h"
+#include "accounts-service-mock.h"
class IndicatorTest : public IndicatorFixture
{
@@ -30,24 +31,35 @@ protected:
{
}
+ std::shared_ptr<AccountsServiceMock> as;
+
virtual void SetUp() override
{
g_setenv("GSETTINGS_SCHEMA_DIR", SCHEMA_DIR, TRUE);
g_setenv("GSETTINGS_BACKEND", "memory", TRUE);
+ as = std::make_shared<AccountsServiceMock>();
+ addMock(*as);
+
IndicatorFixture::SetUp();
}
virtual void TearDown() override
{
+ as.reset();
+
IndicatorFixture::TearDown();
}
};
-TEST_F(IndicatorTest, PhoneMenu) {
- setMenu("/com/canonical/indicator/messages/phone");
+TEST_F(IndicatorTest, RootAction) {
+ setActions("/com/canonical/indicator/messages");
+
+ EXPECT_EVENTUALLY_ACTION_EXISTS("messages");
+ EXPECT_ACTION_STATE_TYPE("messages", G_VARIANT_TYPE("a{sv}"));
+ EXPECT_ACTION_STATE("messages", g_variant_new_parsed("{'icon': <('themed', <['indicator-messages-offline', 'indicator-messages', 'indicator']>)>, 'title': <'Notifications'>, 'accessible-desc': <'Messages'>, 'visible': <false>}"));
}