|
|
@@ -90,27 +90,27 @@ describe('LogAnalyticsDatasource', () => {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- describe('when using $__from and $__to is in the query and range is until now', () => {
|
|
|
+ describe('when using $__timeFrom and $__timeTo is in the query and range is until now', () => {
|
|
|
beforeEach(() => {
|
|
|
- builder.rawQueryString = 'query=Tablename | where myTime >= $__from and myTime <= $__to';
|
|
|
+ builder.rawQueryString = 'query=Tablename | where myTime >= $__timeFrom() and myTime <= $__timeTo()';
|
|
|
});
|
|
|
|
|
|
- it('should replace $__from and $__to with a datetime and the now() function', () => {
|
|
|
+ it('should replace $__timeFrom and $__timeTo with a datetime and the now() function', () => {
|
|
|
const query = builder.generate().uriString;
|
|
|
|
|
|
expect(query).toContain('where%20myTime%20%3E%3D%20datetime(');
|
|
|
- expect(query).toContain('myTime%20%3C%3D%20now()');
|
|
|
+ expect(query).toContain('myTime%20%3C%3D%20datetime(');
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- describe('when using $__from and $__to is in the query and range is a specific interval', () => {
|
|
|
+ describe('when using $__timeFrom and $__timeTo is in the query and range is a specific interval', () => {
|
|
|
beforeEach(() => {
|
|
|
- builder.rawQueryString = 'query=Tablename | where myTime >= $__from and myTime <= $__to';
|
|
|
+ builder.rawQueryString = 'query=Tablename | where myTime >= $__timeFrom() and myTime <= $__timeTo()';
|
|
|
builder.options.range.to = dateTime().subtract(1, 'hour');
|
|
|
builder.options.rangeRaw.to = 'now-1h';
|
|
|
});
|
|
|
|
|
|
- it('should replace $__from and $__to with datetimes', () => {
|
|
|
+ it('should replace $__timeFrom and $__timeTo with datetimes', () => {
|
|
|
const query = builder.generate().uriString;
|
|
|
|
|
|
expect(query).toContain('where%20myTime%20%3E%3D%20datetime(');
|