diff options
| author | Vojta Jina | 2010-10-16 22:52:45 +0100 |
|---|---|---|
| committer | Igor Minar | 2010-10-16 21:29:30 -0700 |
| commit | 312f93574e0d028e13933a342b726382479b421e (patch) | |
| tree | af4956bb60bd3bebb6d315442d674902d23e3003 /test | |
| parent | ff52f47537c9bf5c6acc636f25ae5f7f70d20f3b (diff) | |
| download | angular.js-312f93574e0d028e13933a342b726382479b421e.tar.bz2 | |
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...
Diffstat (limited to 'test')
| -rw-r--r-- | test/FiltersSpec.js | 4 |
1 files changed, 4 insertions, 0 deletions
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()); |
