Skip to content

Commit

Permalink
null filling for UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Egor Ryashin committed Sep 6, 2023
1 parent e74538a commit 18b4315
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { prepareTimeSeries } from "./utils";
import { adjustOffsetForZone } from "@rilldata/web-common/lib/convertTimestampPreview";
import { expect, test } from "vitest";
import { Period, TimeGrain } from "@rilldata/web-common/lib/time/types";

test("should fill in missing intervals", () => {
const original = [
Expand All @@ -11,7 +12,7 @@ test("should fill in missing intervals", () => {
const result = prepareTimeSeries(
original,
null,
"PT1H",
<TimeGrain><any>{ label: "hour", duration: Period.HOUR },
"UTC",
"2023-04-14T10:00:00Z",
"2023-04-14T13:00:00Z"
Expand All @@ -32,7 +33,7 @@ test("should fill in missing intervals in winter", () => {
const result = prepareTimeSeries(
original,
null,
"PT1H",
<TimeGrain><any>{ label: "hour", duration: Period.HOUR },
"UTC",
"2023-01-14T10:00:00Z",
"2023-01-14T13:00:00Z"
Expand All @@ -53,7 +54,7 @@ test("should fill in missing intervals, CET", () => {
const result = prepareTimeSeries(
original,
null,
"PT1H",
<TimeGrain><any>{ label: "hour", duration: Period.HOUR },
"CET",
"2023-01-14T10:00:00Z",
"2023-01-14T13:00:00Z"
Expand Down Expand Up @@ -121,7 +122,7 @@ test("comparison, should fill in missing intervals", () => {
const result = prepareTimeSeries(
original,
comparison,
"PT1H",
<TimeGrain><any>{ label: "hour", duration: Period.HOUR },
"UTC",
"2023-04-14T10:00:00Z",
"2023-04-14T13:00:00Z",
Expand Down Expand Up @@ -158,7 +159,7 @@ test("comparison, should fill in missing intervals, America/Argentina/Buenos_Air
const result = prepareTimeSeries(
original,
comparison,
"PT1H",
<TimeGrain><any>{ label: "hour", duration: Period.HOUR },
"America/Argentina/Buenos_Aires",
"2023-04-14T10:00:00Z",
"2023-04-14T13:00:00Z",
Expand Down Expand Up @@ -195,7 +196,7 @@ test("should include original records", () => {
const result = prepareTimeSeries(
original,
null,
"PT1H",
<TimeGrain><any>{ label: "hour", duration: Period.HOUR },
"UTC",
"2020-01-01T00:00:00Z",
"2020-01-01T01:00:00Z"
Expand Down Expand Up @@ -229,7 +230,7 @@ test("should include comparison records", () => {
const result = prepareTimeSeries(
original,
comparison,
"PT1H",
<TimeGrain><any>{ label: "hour", duration: Period.HOUR },
"UTC",
"2020-01-01T00:00:00Z",
"2020-01-01T01:00:00Z",
Expand Down Expand Up @@ -267,7 +268,7 @@ test("should include comparison records", () => {
const result = prepareTimeSeries(
original,
comparison,
"PT1H",
<TimeGrain><any>{ label: "hour", duration: Period.HOUR },
"UTC",
"2020-01-01T00:00:00Z",
"2020-01-01T01:00:00Z",
Expand Down

0 comments on commit 18b4315

Please sign in to comment.