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...
This commit is contained in:
Vojta Jina
2010-10-16 22:52:45 +01:00
committed by Igor Minar
parent ff52f47537
commit 312f93574e

View File

@@ -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());