test: Add event_date_edit_tzid

This new test check that the tz data in the component is set correctly
after editing an event date end.

See https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/170
This commit is contained in:
Daniel Garcia Moreno
2023-11-09 20:59:59 +00:00
committed by Georges Basile Stavracas Neto
parent 20aa929966
commit 68c921bf60
4 changed files with 105 additions and 43 deletions
+4 -9
View File
@@ -216,17 +216,12 @@ static ECalComponentDateTime*
build_component_from_datetime (GcalEvent *self,
GDateTime *dt)
{
GcalApplication *application;
GcalContext *context;
ICalTime *itt;
gchar *tzid;
ICalTime *itt = NULL;
gchar *tzid = NULL;
if (!dt)
return NULL;
application = GCAL_APPLICATION (g_application_get_default ());
context = gcal_application_get_context (application);
itt = gcal_date_time_to_icaltime (dt);
if (self->all_day)
@@ -236,10 +231,10 @@ build_component_from_datetime (GcalEvent *self,
}
else
{
g_autoptr (GTimeZone) zone = NULL;
ICalTimezone *tz;
GTimeZone *zone;
zone = gcal_context_get_timezone (context);
zone = gcal_util_get_app_timezone_or_local ();
tz = gcal_timezone_to_icaltimezone (zone);
i_cal_time_set_timezone (itt, tz);
tzid = g_strdup (i_cal_timezone_get_tzid (tz));