From 95bc85d108e3564d98f26b7ad17fcc72b2966371 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 7 Dec 2014 20:38:44 -0600 Subject: ensure that disabled alarms aren't shown in indicator-datetime and that notifications aren't shown for them. --- tests/manual | 10 ++++++++++ tests/manual-test-snap.cpp | 2 +- tests/test-actions.cpp | 4 ++-- tests/test-alarm-queue.cpp | 4 ++-- tests/test-live-actions.cpp | 4 ++-- tests/test-menus.cpp | 8 ++++---- tests/test-snap.cpp | 2 +- 7 files changed, 22 insertions(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/manual b/tests/manual index b14a061..2062fd1 100644 --- a/tests/manual +++ b/tests/manual @@ -38,6 +38,16 @@ Test-case indicator-datetime/new-alarm-wakeup
If the device supports haptic feedback, confirm the alarm vibrates.
+Test-case indicator-datetime/disabled-alarms +
+
Create and save an upcoming alarm in ubuntu-clock-app
+
Confirm that the alarm icon appears next to the current time in unity's indicator display
+
Disable the alarm in ubuntu-clock-app
+
When all alarms are disabled or removed, the alarm icon should disappear.
+
Re-enable the alarm in ubuntu-clock-app
+
When the alarm is enabled, the alarm icon should reappear.
+
+ Test-case indicator-datetime/alarm-timezone
In ubuntu-system-settings, change your timezone to a zone you're not in
diff --git a/tests/manual-test-snap.cpp b/tests/manual-test-snap.cpp index d4d9ec9..e0aad89 100644 --- a/tests/manual-test-snap.cpp +++ b/tests/manual-test-snap.cpp @@ -69,7 +69,7 @@ int main(int argc, const char* argv[]) a.summary = "Alarm"; a.url = "alarm:///hello-world"; a.uid = "D4B57D50247291478ED31DED17FF0A9838DED402"; - a.has_alarms = true; + a.type = Appointment::UBUNTU_ALARM; auto begin = g_date_time_new_local(2014,12,25,0,0,0); auto end = g_date_time_add_full(begin,0,0,1,0,0,-1); a.begin = begin; diff --git a/tests/test-actions.cpp b/tests/test-actions.cpp index aefeac0..fc89426 100644 --- a/tests/test-actions.cpp +++ b/tests/test-actions.cpp @@ -39,7 +39,7 @@ class ActionsFixture: public StateFixture a1.summary = "Alarm"; a1.summary = "http://www.example.com/"; a1.uid = "example"; - a1.has_alarms = true; + a1.type = Appointment::UBUNTU_ALARM; a1.begin = a1.end = tomorrow; Appointment a2; // a non-alarm appointment @@ -47,7 +47,7 @@ class ActionsFixture: public StateFixture a2.summary = "Other Text"; a2.summary = "http://www.monkey.com/"; a2.uid = "monkey"; - a2.has_alarms = false; + a1.type = Appointment::EVENT; a2.begin = a2.end = tomorrow; return std::vector({a1, a2}); diff --git a/tests/test-alarm-queue.cpp b/tests/test-alarm-queue.cpp index d2de8ac..12ffe92 100644 --- a/tests/test-alarm-queue.cpp +++ b/tests/test-alarm-queue.cpp @@ -80,7 +80,7 @@ protected: a1.summary = "Alarm"; a1.summary = "http://www.example.com/"; a1.uid = "example"; - a1.has_alarms = true; + a1.type = Appointment::UBUNTU_ALARM; a1.begin = tomorrow_begin; a1.end = tomorrow_end; @@ -92,7 +92,7 @@ protected: a2.summary = "Other Text"; a2.summary = "http://www.monkey.com/"; a2.uid = "monkey"; - a2.has_alarms = false; + a1.type = Appointment::EVENT; a2.begin = ubermorgen_begin; a2.end = ubermorgen_end; diff --git a/tests/test-live-actions.cpp b/tests/test-live-actions.cpp index 2cd6eef..1197e3e 100644 --- a/tests/test-live-actions.cpp +++ b/tests/test-live-actions.cpp @@ -312,11 +312,11 @@ TEST_F(LiveActionsFixture, PhoneOpenAppointment) a.uid = "some-uid"; a.begin = DateTime::NowLocal(); - a.has_alarms = false; + a.type = Appointment::EVENT; m_actions->phone_open_appointment(a); EXPECT_EQ(calendar_app_url, m_live_actions->last_url); - a.has_alarms = true; + a.type = Appointment::UBUNTU_ALARM; m_actions->phone_open_appointment(a); EXPECT_EQ(clock_app_url, m_live_actions->last_url); diff --git a/tests/test-menus.cpp b/tests/test-menus.cpp index 363a132..e0e63ac 100644 --- a/tests/test-menus.cpp +++ b/tests/test-menus.cpp @@ -191,7 +191,7 @@ private: a1.summary = "Alarm"; a1.summary = "http://www.example.com/"; a1.uid = "example"; - a1.has_alarms = true; + a1.type = Appointment::UBUNTU_ALARM; a1.begin = a1.end = tomorrow; Appointment a2; // a non-alarm appointment @@ -199,7 +199,7 @@ private: a2.summary = "Other Text"; a2.summary = "http://www.monkey.com/"; a2.uid = "monkey"; - a2.has_alarms = false; + a1.type = Appointment::EVENT; a2.begin = a2.end = tomorrow; return std::vector({a1, a2}); @@ -212,7 +212,7 @@ private: // confirm it has the right x-canonical-type gchar * str = nullptr; g_menu_model_get_item_attribute(section, index, "x-canonical-type", "s", &str); - if (appt.has_alarms) + if (appt.is_ubuntu_alarm()) EXPECT_STREQ("com.canonical.indicator.alarm", str); else EXPECT_STREQ("com.canonical.indicator.appointment", str); @@ -245,7 +245,7 @@ private: g_clear_pointer(&str, g_free); // confirm that alarms have an icon - if (appt.has_alarms) + if (appt.is_ubuntu_alarm()) { auto v = g_menu_model_get_item_attribute_value(section, index, diff --git a/tests/test-snap.cpp b/tests/test-snap.cpp index 21202f4..972c493 100644 --- a/tests/test-snap.cpp +++ b/tests/test-snap.cpp @@ -108,7 +108,7 @@ protected: appt.summary = "Alarm"; appt.url = "alarm:///hello-world"; appt.uid = "D4B57D50247291478ED31DED17FF0A9838DED402"; - appt.has_alarms = true; + appt.type = Appointment::EVENT; auto begin = g_date_time_new_local(2014,12,25,0,0,0); auto end = g_date_time_add_full(begin,0,0,1,0,0,-1); appt.begin = begin; -- cgit v1.2.3