From 312f93574e0d028e13933a342b726382479b421e Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Sat, 16 Oct 2010 22:52:45 +0100 Subject: Fixed filter date test - remove dependency on machine timezone It would be better to separate the time-zone logic to a separate unit and test just this logic. This logic is simply convert minutes to HH:MM, the source of time-zone is from date object... --- test/FiltersSpec.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/FiltersSpec.js b/test/FiltersSpec.js index 1767bede..e5d1b8f4 100644 --- a/test/FiltersSpec.js +++ b/test/FiltersSpec.js @@ -88,7 +88,11 @@ describe('filter', function(){ describe('date', function(){ var date = angular.String.toDate('2010-10-13T14:45:23Z'); + + //butt-ugly hack: force the date to be 2pm PDT for locale testing date.setHours(14); + date.getTimezoneOffset = function() { return 7 * 60; }; + it('should do basic filter', function() { expect(filter.date(date)).toEqual(date.toLocaleDateString()); -- cgit v1.2.3