mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(elasticsearch): minor fix to elasticsearch unit tests so that they work in any timezone, fixes #3010
This commit is contained in:
@@ -36,7 +36,7 @@ describe('ElasticDatasource', function() {
|
||||
ctx.ds.testDatasource();
|
||||
ctx.$rootScope.$apply();
|
||||
|
||||
var today = moment().format("YYYY.MM.DD");
|
||||
var today = moment.utc().format("YYYY.MM.DD");
|
||||
expect(requestOptions.url).to.be("http://es.com/asd-" + today + '/_stats');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('IndexPattern', function() {
|
||||
describe('when getting index for today', function() {
|
||||
it('should return correct index name', function() {
|
||||
var pattern = new IndexPattern('[asd-]YYYY.MM.DD', 'Daily');
|
||||
var expected = 'asd-' + moment().format('YYYY.MM.DD');
|
||||
var expected = 'asd-' + moment.utc().format('YYYY.MM.DD');
|
||||
|
||||
expect(pattern.getIndexForToday()).to.be(expected);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user