aboutsummaryrefslogtreecommitdiff
path: root/tests/test-live-actions.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-03-24 16:18:12 +0000
committerCI bot <ps-jenkins@lists.canonical.com>2014-03-24 16:18:12 +0000
commit45abbf3db686fd87ed5eb3eef38618ffe0eedb8a (patch)
treee23159158aaa9d0879c3571aac61ec230638186a /tests/test-live-actions.cpp
parent7a6e36e548f574ba1e6ea49af63b2ce0397a848f (diff)
parentf88a1cf792c1b8786db5f447fed148fcd2166d07 (diff)
downloadayatana-indicator-datetime-45abbf3db686fd87ed5eb3eef38618ffe0eedb8a.tar.gz
ayatana-indicator-datetime-45abbf3db686fd87ed5eb3eef38618ffe0eedb8a.tar.bz2
ayatana-indicator-datetime-45abbf3db686fd87ed5eb3eef38618ffe0eedb8a.zip
Change the desktop menu's settings menuitem's label to match the spec. Fixes: 1296585
Diffstat (limited to 'tests/test-live-actions.cpp')
-rw-r--r--tests/test-live-actions.cpp91
1 files changed, 71 insertions, 20 deletions
diff --git a/tests/test-live-actions.cpp b/tests/test-live-actions.cpp
index d6ef424..c67b380 100644
--- a/tests/test-live-actions.cpp
+++ b/tests/test-live-actions.cpp
@@ -252,44 +252,95 @@ TEST_F(LiveActionsFixture, SetLocation)
EXPECT_EQ(expected, m_state->settings->timezone_name.get());
}
-TEST_F(LiveActionsFixture, OpenDesktopSettings)
+/***
+****
+***/
+
+TEST_F(LiveActionsFixture, DesktopOpenAlarmApp)
+{
+ m_actions->desktop_open_alarm_app();
+ const std::string expected = "evolution -c calendar";
+ EXPECT_EQ(expected, m_live_actions->last_cmd);
+}
+
+TEST_F(LiveActionsFixture, DesktopOpenAppointment)
+{
+ Appointment a;
+ a.uid = "some-uid";
+ a.begin = DateTime::NowLocal();
+ m_actions->desktop_open_appointment(a);
+ const std::string expected_substr = "evolution \"calendar:///?startdate=";
+ EXPECT_NE(m_live_actions->last_cmd.find(expected_substr), std::string::npos);
+}
+
+TEST_F(LiveActionsFixture, DesktopOpenCalendarApp)
+{
+ m_actions->desktop_open_calendar_app(DateTime::NowLocal());
+ const std::string expected_substr = "evolution \"calendar:///?startdate=";
+ EXPECT_NE(m_live_actions->last_cmd.find(expected_substr), std::string::npos);
+}
+
+TEST_F(LiveActionsFixture, DesktopOpenSettingsApp)
{
- m_actions->open_desktop_settings();
+ m_actions->desktop_open_settings_app();
const std::string expected_substr = "control-center";
EXPECT_NE(m_live_actions->last_cmd.find(expected_substr), std::string::npos);
}
-TEST_F(LiveActionsFixture, OpenPlanner)
+/***
+****
+***/
+
+namespace
{
- m_actions->open_planner();
- const std::string expected = "evolution -c calendar";
- EXPECT_EQ(expected, m_live_actions->last_cmd);
+ const std::string clock_app_url = "appid://com.ubuntu.clock/clock/current-user-version";
+
+ const std::string calendar_app_url = "appid://com.ubuntu.calendar/calendar/current-user-version";
}
-TEST_F(LiveActionsFixture, OpenPhoneSettings)
+TEST_F(LiveActionsFixture, PhoneOpenAlarmApp)
{
- m_actions->open_phone_settings();
- const std::string expected = "settings:///system/time-date";
- EXPECT_EQ(expected, m_live_actions->last_url);
+ m_actions->phone_open_alarm_app();
+ EXPECT_EQ(clock_app_url, m_live_actions->last_url);
}
-TEST_F(LiveActionsFixture, OpenPhoneClockApp)
+TEST_F(LiveActionsFixture, PhoneOpenAppointment)
{
- m_actions->open_phone_clock_app();
- const std::string expected = "appid://com.ubuntu.clock/clock/current-user-version";
+ Appointment a;
+
+ a.uid = "some-uid";
+ a.begin = DateTime::NowLocal();
+ a.has_alarms = false;
+ m_actions->phone_open_appointment(a);
+ EXPECT_EQ(calendar_app_url, m_live_actions->last_url);
+
+ a.has_alarms = true;
+ m_actions->phone_open_appointment(a);
+ EXPECT_EQ(clock_app_url, m_live_actions->last_url);
+
+ a.url = "appid://blah";
+ m_actions->phone_open_appointment(a);
+ EXPECT_EQ(a.url, m_live_actions->last_url);
+}
+
+TEST_F(LiveActionsFixture, PhoneOpenCalendarApp)
+{
+ m_actions->phone_open_calendar_app(DateTime::NowLocal());
+ const std::string expected = "appid://com.ubuntu.calendar/calendar/current-user-version";
EXPECT_EQ(expected, m_live_actions->last_url);
}
-TEST_F(LiveActionsFixture, OpenPlannerAt)
+TEST_F(LiveActionsFixture, PhoneOpenSettingsApp)
{
- const auto now = DateTime::NowLocal();
- m_actions->open_planner_at(now);
- const auto today_begins = now.add_full(0, 0, 0, -now.hour(), -now.minute(), -now.seconds());
- const auto gmt = today_begins.to_timezone("UTC");
- const auto expected = gmt.format("evolution \"calendar:///?startdate=%Y%m%dT%H%M%SZ\"");
- EXPECT_EQ(expected, m_live_actions->last_cmd);
+ m_actions->phone_open_settings_app();
+ const std::string expected = "settings:///system/time-date";
+ EXPECT_EQ(expected, m_live_actions->last_url);
}
+/***
+****
+***/
+
TEST_F(LiveActionsFixture, CalendarState)
{
// init the clock