Skip to content

Commit

Permalink
update test and type
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Nov 17, 2022
1 parent 16c6ffd commit af3e1ad
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ export const getInlineErrorFilters = () => [
],
},
},
{
range: {
'monitor.timespan': getTimeSpanFilter(),
},
},
getTimeSpanFilter(),
EXCLUDE_RUN_ONCE_FILTER,
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('useInlineErrors', function () {
{
range: {
'monitor.timespan': {
gte: '2022-01-01T23:55:00.000Z',
gte: '2022-01-01T23:40:00.000Z',
lte: '2022-01-02T00:00:00.000Z',
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ export const getInlineErrorFilters = () => [
],
},
},
{
range: {
'monitor.timespan': getTimeSpanFilter(),
},
},
getTimeSpanFilter(),
EXCLUDE_RUN_ONCE_FILTER,
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('useInlineErrorsCount', function () {
{
range: {
'monitor.timespan': {
gte: '2022-01-01T23:55:00.000Z',
gte: '2022-01-01T23:40:00.000Z',
lte: '2022-01-02T00:00:00.000Z',
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ describe(QueryContext, () => {
describe('timespanClause()', () => {
it('should always cover the last 20m', () => {
// 5m expected range between GTE and LTE in the response
// since timespan is hardcoded to 5m
// since timespan is hardcoded to 20m
expect(qc.timespanClause()).toEqual({
range: {
'monitor.timespan': {
// end date minus 5m
// end date minus 20
gte: new Date(Date.parse(rangeEnd) - 20 * 60 * 1000).toISOString(),
lte: rangeEnd,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class QueryContext {
}

const tsEnd = parseRelativeDate(this.dateRangeEnd, { roundUp: true })!;
const tsStart = moment(tsEnd).subtract(5, 'minutes');
const tsStart = moment(tsEnd).subtract(20, 'minutes');

return {
range: {
Expand Down

0 comments on commit af3e1ad

Please sign in to comment.