Explorar o código

fix date test (#9811)

Mitsuhiro Tanda %!s(int64=8) %!d(string=hai) anos
pai
achega
e46814ba05

+ 1 - 1
public/app/core/specs/datemath.jest.ts

@@ -48,7 +48,7 @@ describe("DateMath", () => {
 
   it("now/d on a utc dashboard should be start of the current day in UTC time", () => {
     var today = new Date();
-    var expected = new Date(Date.UTC(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0, 0));
+    var expected = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate(), 0, 0, 0, 0));
 
     var startOfDay = dateMath.parse('now/d', false, 'utc').valueOf();
     expect(startOfDay).toBe(expected.getTime());

+ 1 - 1
public/app/core/specs/kbn.jest.ts

@@ -114,7 +114,7 @@ describe('date time formats', function() {
 
   it('should format as US date', function() {
     var str = kbn.valueFormats.dateTimeAsUS(1505634997920, 1);
-    expect(str).toBe(moment(1505634997920).format('MM/DD/YYYY H:mm:ss a'));
+    expect(str).toBe(moment(1505634997920).format('MM/DD/YYYY h:mm:ss a'));
   });
 
   it('should format as US date and skip date when today', function() {