Commit 756d39ba authored by Robert Knight's avatar Robert Knight

Fix timestamp component test in Chrome

`toLocaleTimeString()` in Chrome produces an `hh:mm:ss` output on my
system whereas the rendered timestamp only has `hh:mm`.

Re-using `format` from date-util avoids this hazard.
parent acc04671
'use strict';
var angular = require('angular');
var escapeStringRegexp = require('escape-string-regexp');
var dateUtil = require('../../util/date');
var util = require('../../directive/test/util');
describe('timestamp', function () {
......@@ -83,8 +83,7 @@ describe('timestamp', function () {
// The exact format of the result will depend on the current locale,
// but check that at least the current year and time are present
assert.match(element.ctrl.absoluteTimestamp, new RegExp('.*2016.*' +
escapeStringRegexp(expectedDate.toLocaleTimeString())));
assert.match(element.ctrl.absoluteTimestamp, dateUtil.format(expectedDate));
});
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment