← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~carla-sella/ubuntu-calendar-app/weekview-testing-stubs-completed into lp:ubuntu-calendar-app

 

Carla Sella has proposed merging lp:~carla-sella/ubuntu-calendar-app/weekview-testing-stubs-completed into lp:ubuntu-calendar-app with lp:~carla-sella/ubuntu-calendar-app/dayview-test-default-view as a prerequisite.

Requested reviews:
  Nicholas Skaggs (nskaggs)
  Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot): continuous-integration

For more details, see:
https://code.launchpad.net/~carla-sella/ubuntu-calendar-app/weekview-testing-stubs-completed/+merge/254495

Completing test_default_view in test_weekview.py.
-- 
Your team Ubuntu Calendar Developers is subscribed to branch lp:ubuntu-calendar-app.
=== modified file 'tests/autopilot/calendar_app/__init__.py'
--- tests/autopilot/calendar_app/__init__.py	2015-03-07 10:14:46 +0000
+++ tests/autopilot/calendar_app/__init__.py	2015-03-29 16:15:06 +0000
@@ -427,6 +427,17 @@
                 sorteddays.insert(0, day)
         return sorteddays
 
+    @autopilot.logging.log_action(logger.info)
+    def get_headerdatecomponent(self, now):
+        today = datetime.date(now.year, now.month, now.day)
+        header_date_components = self.select_many('HeaderDateComponent')
+        for header in header_date_components:
+            header_date = datetime.date(header.date.datetime.year,
+                                        header.date.datetime.month,
+                                        header.date.datetime.day)
+            if header_date == today:
+                return header
+
 
 class MonthView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
 

=== modified file 'tests/autopilot/calendar_app/tests/test_weekview.py'
--- tests/autopilot/calendar_app/tests/test_weekview.py	2015-02-26 16:29:18 +0000
+++ tests/autopilot/calendar_app/tests/test_weekview.py	2015-03-29 16:15:06 +0000
@@ -61,7 +61,12 @@
         self.assertThat(self.app.main_view.get_month_year(self.week_view),
                         Equals(expected_month_name_year))
 
-        # TODO: check current day is highlighted
+        # check current day is highlighted
+        header_date = self.week_view.get_headerdatecomponent(now)
+        self.assertEquals(header_date.dayColor[0], 221)
+        self.assertEquals(header_date.dayColor[1], 72)
+        self.assertEquals(header_date.dayColor[2], 20)
+        self.assertEquals(header_date.dayColor[3], 255)
 
     # These testing stubs need completed
     # def test_scroll_week_must_scroll_within_week(self):


Follow ups