Skip to content

Commit

Permalink
Fix query tests
Browse files Browse the repository at this point in the history
  • Loading branch information
benvinegar committed Apr 1, 2024
1 parent 1df67c6 commit c5a50ff
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/analytics/query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe("AnalyticsEngineAPI", () => {
const result1 = await api.getViewsGroupedByInterval(
"example.com",
"DAY",
7,
new Date("2024-01-11 00:00:00"), // local time (because tz also passed)
"America/New_York",
);

Expand All @@ -104,7 +104,7 @@ describe("AnalyticsEngineAPI", () => {
const result2 = await api.getViewsGroupedByInterval(
"example.com",
"DAY",
5,
new Date("2024-01-13 00:00:00"), // local time (because tz also passed)
"America/New_York",
);
expect(result2).toEqual([
Expand Down Expand Up @@ -146,7 +146,7 @@ describe("AnalyticsEngineAPI", () => {
const result1 = await api.getViewsGroupedByInterval(
"example.com",
"HOUR",
1,
new Date("2024-01-17 05:00:00"), // local time (because tz also passed)
"America/New_York",
);

Expand Down Expand Up @@ -206,7 +206,7 @@ describe("AnalyticsEngineAPI", () => {
}),
);

const result = api.getCounts("example.com", 7);
const result = api.getCounts("example.com", "7d");

// verify fetch was invoked before awaiting result
expect(fetch).toHaveBeenCalled();
Expand Down Expand Up @@ -242,7 +242,7 @@ describe("AnalyticsEngineAPI", () => {
const result = api.getVisitorCountByColumn(
"example.com",
"country",
7,
"7d",
);

// verify fetch was invoked before awaiting result
Expand Down Expand Up @@ -278,7 +278,7 @@ describe("AnalyticsEngineAPI", () => {
}),
);

const result = api.getSitesOrderedByHits(7);
const result = api.getSitesOrderedByHits("7d");
// verify fetch was invoked before awaiting result
expect(fetch).toHaveBeenCalled();
expect(await result).toEqual([
Expand Down

0 comments on commit c5a50ff

Please sign in to comment.