Skip to content

Commit

Permalink
Incorporate PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewvc committed Feb 3, 2020
1 parent 536662b commit cfd819c
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ describe(QueryContext, () => {
};

let qc: QueryContext;
const makeQueryContext = () => {
return new QueryContext({}, rangeStart, rangeEnd, pagination, null, 10);
};
beforeEach(() => (qc = makeQueryContext()));
beforeEach(() => (qc = new QueryContext({}, rangeStart, rangeEnd, pagination, null, 10)));

describe('dateRangeFilter()', () => {
const expectedRange = {
Expand All @@ -36,7 +33,7 @@ describe(QueryContext, () => {
describe('when hasTimespan() is true', () => {
it('should create a date range filter including the timespan', async () => {
const mockHasTimespan = jest.fn();
mockHasTimespan.mockReturnValue(Promise.resolve(true));
mockHasTimespan.mockReturnValue(true);
qc.hasTimespan = mockHasTimespan;

expect(await qc.dateRangeFilter()).toEqual({
Expand All @@ -60,7 +57,7 @@ describe(QueryContext, () => {
describe('when hasTimespan() is false', () => {
it('should only use the timestamp fields in the returned filter', async () => {
const mockHasTimespan = jest.fn();
mockHasTimespan.mockReturnValue(Promise.resolve(false));
mockHasTimespan.mockReturnValue(false);
qc.hasTimespan = mockHasTimespan;

expect(await qc.dateRangeFilter()).toEqual(expectedRange);
Expand Down

0 comments on commit cfd819c

Please sign in to comment.