mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
simplified fix for 12030
This commit is contained in:
parent
4c4e5533a1
commit
0f4904038e
@ -29,6 +29,7 @@ describe('timeSrv', () => {
|
||||
beforeEach(() => {
|
||||
timeSrv = new TimeSrv(rootScope, jest.fn(), location, timer, { isGrafanaVisibile: jest.fn() });
|
||||
timeSrv.init(_dashboard);
|
||||
_dashboard.refresh = false;
|
||||
});
|
||||
|
||||
describe('timeRange', () => {
|
||||
@ -79,6 +80,23 @@ describe('timeSrv', () => {
|
||||
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', () => {
|
||||
location = {
|
||||
search: jest.fn(() => ({
|
||||
|
Loading…
Reference in New Issue
Block a user