diff --git a/modules/@angular/common/test/pipes/date_pipe_spec.ts b/modules/@angular/common/test/pipes/date_pipe_spec.ts index c3b3053e68..8ae821255c 100644 --- a/modules/@angular/common/test/pipes/date_pipe_spec.ts +++ b/modules/@angular/common/test/pipes/date_pipe_spec.ts @@ -20,7 +20,8 @@ export function main() { // TODO(mlaval): enable tests when Intl API is no longer used, see // https://github.com/angular/angular/issues/3333 - if (browserDetection.supportsIntlApi) { + // Have to restrict to Chrome as IE uses a different formatting + if (browserDetection.supportsIntlApi && browserDetection.isChromeDesktop) { describe('supports', () => { it('should support date', () => { expect(() => pipe.transform(date)).not.toThrow(); }); it('should support int', () => { expect(() => pipe.transform(123456789)).not.toThrow(); }); @@ -56,13 +57,13 @@ export function main() { expect(pipe.transform(date, 'MMM d')).toEqual('Jun 15'); expect(pipe.transform(date, 'dd/MM/yyyy')).toEqual('15/06/2015'); expect(pipe.transform(date, 'MM/dd/yyyy')).toEqual('06/15/2015'); - expect(pipe.transform(date, 'yMEd')).toEqual('Mon, 6/15/2015'); - expect(pipe.transform(date, 'MEd')).toEqual('Mon, 6/15'); - expect(pipe.transform(date, 'MMMd')).toEqual('Jun 15'); + expect(pipe.transform(date, 'yMEd')).toEqual('20156Mon15'); + expect(pipe.transform(date, 'MEd')).toEqual('6Mon15'); + expect(pipe.transform(date, 'MMMd')).toEqual('Jun15'); expect(pipe.transform(date, 'yMMMMEEEEd')).toEqual('Monday, June 15, 2015'); expect(pipe.transform(date, 'jms')).toEqual('9:43:11 PM'); - expect(pipe.transform(date, 'ms')).toEqual('43:11'); - expect(pipe.transform(date, 'jm')).toEqual('9:43'); + expect(pipe.transform(date, 'ms')).toEqual('4311'); + expect(pipe.transform(date, 'jm')).toEqual('9:43 PM'); }); it('should format with pattern aliases', () => { diff --git a/modules/@angular/common/test/pipes/number_pipe_spec.ts b/modules/@angular/common/test/pipes/number_pipe_spec.ts index 92096c1f53..4191acc96e 100644 --- a/modules/@angular/common/test/pipes/number_pipe_spec.ts +++ b/modules/@angular/common/test/pipes/number_pipe_spec.ts @@ -7,7 +7,8 @@ export function main() { describe('Number pipes', () => { // TODO(mlaval): enable tests when Intl API is no longer used, see // https://github.com/angular/angular/issues/3333 - if (browserDetection.supportsIntlApi) { + // Have to restrict to Chrome as IE uses a different formatting + if (browserDetection.supportsIntlApi && browserDetection.isChromeDesktop) { describe('DecimalPipe', () => { var pipe: DecimalPipe; diff --git a/modules/@angular/platform-browser/testing/browser_util.ts b/modules/@angular/platform-browser/testing/browser_util.ts index fdb53715b1..cf47e3ba52 100644 --- a/modules/@angular/platform-browser/testing/browser_util.ts +++ b/modules/@angular/platform-browser/testing/browser_util.ts @@ -1,6 +1,6 @@ import {getDOM} from '../src/dom/dom_adapter'; import {ListWrapper} from '../src/facade/collection'; -import {RegExp, RegExpWrapper, StringWrapper, isPresent, isString, global} from '../src/facade/lang'; +import {RegExp, RegExpWrapper, StringWrapper, global, isPresent, isString} from '../src/facade/lang'; export class BrowserDetection { private _overrideUa: string; @@ -40,9 +40,7 @@ export class BrowserDetection { // The Intl API is only properly supported in recent Chrome and Opera. // Note: Edge is disguised as Chrome 42, so checking the "Edge" part is needed, // see https://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx - get supportsIntlApi(): boolean { - return !!(global).Intl; - } + get supportsIntlApi(): boolean { return !!(global).Intl; } get isChromeDesktop(): boolean { return this._ua.indexOf('Chrome') > -1 && this._ua.indexOf('Mobile Safari') == -1 &&