@@ -169,7 +169,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController.QueryComparisonsTest do
169169 assert actual_comparison_last_date == expected_comparison_last_date
170170 end
171171
172- test "timeseries last 90d period in year_over_year comparison" , % {
172+ test "timeseries last 91d period in year_over_year comparison" , % {
173173 conn: conn ,
174174 site: site
175175 } do
@@ -178,19 +178,19 @@ defmodule PlausibleWeb.Api.ExternalStatsController.QueryComparisonsTest do
178178 build ( :pageview , timestamp: ~N[ 2021-04-01 00:00:00] ) ,
179179 build ( :pageview , timestamp: ~N[ 2021-04-05 00:00:00] ) ,
180180 build ( :pageview , timestamp: ~N[ 2021-04-05 00:00:00] ) ,
181- build ( :pageview , timestamp: ~N[ 2021-06-29 00:00:00] ) ,
181+ build ( :pageview , timestamp: ~N[ 2021-06-30 00:00:00] ) ,
182182 build ( :pageview , timestamp: ~N[ 2022-04-01 00:00:00] ) ,
183183 build ( :pageview , timestamp: ~N[ 2022-04-05 00:00:00] ) ,
184- build ( :pageview , timestamp: ~N[ 2022-06-29 00:00:00] ) ,
185- build ( :pageview , timestamp: ~N[ 2022-06-30 00:00:00] )
184+ build ( :pageview , timestamp: ~N[ 2022-06-30 00:00:00] ) ,
185+ build ( :pageview , timestamp: ~N[ 2022-07-01 00:00:00] )
186186 ] )
187187
188188 conn =
189189 post ( conn , "/api/v2/query-internal-test" , % {
190190 "site_id" => site . domain ,
191191 "metrics" => [ "visitors" ] ,
192- "date_range" => "90d " ,
193- "date" => "2022-06-30 " ,
192+ "date_range" => "91d " ,
193+ "date" => "2022-07-01 " ,
194194 "dimensions" => [ "time:day" ] ,
195195 "include" => % {
196196 "time_labels" => true ,
@@ -205,7 +205,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController.QueryComparisonsTest do
205205
206206 assert "2022-04-01" = List . first ( time_labels )
207207 assert "2022-04-05" = Enum . at ( time_labels , 4 )
208- assert "2022-06-29 " = List . last ( time_labels )
208+ assert "2022-06-30 " = List . last ( time_labels )
209209
210210 assert % {
211211 "dimensions" => [ "2022-04-01" ] ,
@@ -226,13 +226,13 @@ defmodule PlausibleWeb.Api.ExternalStatsController.QueryComparisonsTest do
226226 } = Enum . find ( results , & ( & 1 [ "dimensions" ] == [ "2022-04-05" ] ) )
227227
228228 assert % {
229- "dimensions" => [ "2022-06-29 " ] ,
229+ "dimensions" => [ "2022-06-30 " ] ,
230230 "metrics" => [ 1 ] ,
231231 "comparison" => % {
232- "dimensions" => [ "2021-06-29 " ] ,
232+ "dimensions" => [ "2021-06-30 " ] ,
233233 "metrics" => [ 1 ]
234234 }
235- } = Enum . find ( results , & ( & 1 [ "dimensions" ] == [ "2022-06-29 " ] ) )
235+ } = Enum . find ( results , & ( & 1 [ "dimensions" ] == [ "2022-06-30 " ] ) )
236236 end
237237
238238 test "dimensional comparison with low limit" , % { conn: conn , site: site } do
0 commit comments