aboutsummaryrefslogtreecommitdiff
path: root/tests/test-live-actions.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-03-14 17:37:00 +0000
committerCI bot <ps-jenkins@lists.canonical.com>2014-03-14 17:37:00 +0000
commit9f3136ba1c79020c10e58fa53e87a84bcce7dc29 (patch)
treefa0c19e8e5c7f362b7a04f0ad3e6f57d96c1462c /tests/test-live-actions.cpp
parent39d8fc602053397a3596d6d35afb5738b09b05a6 (diff)
parent35b0a3601f1d7d9f757467ffc7b909c461c2f49d (diff)
downloadayatana-indicator-datetime-9f3136ba1c79020c10e58fa53e87a84bcce7dc29.tar.gz
ayatana-indicator-datetime-9f3136ba1c79020c10e58fa53e87a84bcce7dc29.tar.bz2
ayatana-indicator-datetime-9f3136ba1c79020c10e58fa53e87a84bcce7dc29.zip
When the user clicks on a date in the calendar, update the "Upcoming Events" section to show events starting at that date. Fixes: 1290169, 1290171, 1291468
Diffstat (limited to 'tests/test-live-actions.cpp')
-rw-r--r--tests/test-live-actions.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/test-live-actions.cpp b/tests/test-live-actions.cpp
index eab8596..d6ef424 100644
--- a/tests/test-live-actions.cpp
+++ b/tests/test-live-actions.cpp
@@ -284,7 +284,9 @@ TEST_F(LiveActionsFixture, OpenPlannerAt)
{
const auto now = DateTime::NowLocal();
m_actions->open_planner_at(now);
- const std::string expected = now.format("evolution \"calendar:///?startdate=%Y%m%d\"");
+ 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);
}
@@ -295,7 +297,8 @@ TEST_F(LiveActionsFixture, CalendarState)
const DateTime now (tmp);
g_date_time_unref (tmp);
m_mock_state->mock_clock->set_localtime (now);
- m_state->planner->time.set(now);
+ m_state->calendar_month->month().set(now);
+ //m_state->planner->time.set(now);
///
/// Test the default calendar state.
@@ -315,7 +318,7 @@ TEST_F(LiveActionsFixture, CalendarState)
// calendar-day should be in sync with m_state->calendar_day
v = g_variant_lookup_value (calendar_state, "calendar-day", G_VARIANT_TYPE_INT64);
EXPECT_TRUE (v != nullptr);
- EXPECT_EQ (m_state->planner->time.get().to_unix(), g_variant_get_int64(v));
+ EXPECT_EQ (m_state->calendar_month->month().get().to_unix(), g_variant_get_int64(v));
g_clear_pointer (&v, g_variant_unref);
// show-week-numbers should be false because MockSettings defaults everything to 0
@@ -356,7 +359,7 @@ TEST_F(LiveActionsFixture, CalendarState)
a2.begin = next_begin;
a2.end = next_end;
- m_state->planner->this_month.set(std::vector<Appointment>({a1, a2}));
+ m_state->calendar_month->appointments().set(std::vector<Appointment>({a1, a2}));
///
/// Now test the calendar state again.