Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interop test for daily forecast #1823

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

66 changes: 0 additions & 66 deletions api-interop-layer/_tests_to_copy/Test/NewRelicMetrics.php.test

This file was deleted.

10 changes: 10 additions & 0 deletions api-interop-layer/data/forecast/daily.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ export default (data, { timezone }) => {
const days = [];
let previousDay = -1;

// The API returns a list of day periods. Every calendar day is represented by
// one or two day periods. They’re 12 hours each from 6am to 6pm and from 6pm to
// 6am. The API includes an isDaytime property so we know which one is for the
// day and night.

// So, we iterate over all day periods and bundle up them into days.
for (const period of data.properties.periods) {
const start = dayjsOffset(period.startTime);

Expand All @@ -45,6 +51,10 @@ export default (data, { timezone }) => {
days[days.length - 1].end = period.endTime;
}

// if the collection of weather days has only one item in it, it is the
// first day of the forecast. additionally, if this day has no periods, that
// means this is the first period of the day, and if this period is not
// marked as daytime then it must be an overnight period.
Comment on lines +54 to +57
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed, I think this logic may not actually be correct. I'll create a debt/but ticket to investigate.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1852 is created

const isOvernight =
days.length === 1 &&
dayPeriod.periods.length === 0 &&
Expand Down
Loading
Loading