Commit 0f490403 by Torkel Ödegaard

simplified fix for 12030

parent 4c4e5533
...@@ -29,6 +29,7 @@ describe('timeSrv', () => { ...@@ -29,6 +29,7 @@ describe('timeSrv', () => {
beforeEach(() => { beforeEach(() => {
timeSrv = new TimeSrv(rootScope, jest.fn(), location, timer, { isGrafanaVisibile: jest.fn() }); timeSrv = new TimeSrv(rootScope, jest.fn(), location, timer, { isGrafanaVisibile: jest.fn() });
timeSrv.init(_dashboard); timeSrv.init(_dashboard);
_dashboard.refresh = false;
}); });
describe('timeRange', () => { describe('timeRange', () => {
...@@ -79,6 +80,23 @@ describe('timeSrv', () => { ...@@ -79,6 +80,23 @@ describe('timeSrv', () => {
expect(time.to.valueOf()).toEqual(new Date('2014-05-20T03:10:22Z').getTime()); expect(time.to.valueOf()).toEqual(new Date('2014-05-20T03:10:22Z').getTime());
}); });
it('should ignore refresh if time absolute', () => {
location = {
search: jest.fn(() => ({
from: '20140410T052010',
to: '20140520T031022',
})),
};
timeSrv = new TimeSrv(rootScope, jest.fn(), location, timer, { isGrafanaVisibile: jest.fn() });
// dashboard saved with refresh on
_dashboard.refresh = true;
timeSrv.init(_dashboard);
expect(timeSrv.refresh).toBe(false);
});
it('should handle formatted dates without time', () => { it('should handle formatted dates without time', () => {
location = { location = {
search: jest.fn(() => ({ search: jest.fn(() => ({
......
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