@@ -149,6 +149,7 @@ func TestUsageReport_CreditSummaryForTeams(t *testing.T) {
149
149
}
150
150
151
151
func TestUsageReportConversionToDBUsageRecords (t * testing.T ) {
152
+ maxStopTime := time .Date (2022 , 05 , 31 , 23 , 00 , 00 , 00 , time .UTC )
152
153
teamID := uuid .New ().String ()
153
154
teamAttributionID := db .NewTeamAttributionID (teamID )
154
155
instanceId := uuid .New ()
@@ -178,7 +179,7 @@ func TestUsageReportConversionToDBUsageRecords(t *testing.T) {
178
179
AttributionID : teamAttributionID ,
179
180
StartedAt : creationTime .Time (),
180
181
StoppedAt : sql.NullTime {Time : stoppedTime .Time (), Valid : true },
181
- CreditsUsed : 0 ,
182
+ CreditsUsed : 470 ,
182
183
GenerationId : 0 ,
183
184
}},
184
185
},
@@ -200,15 +201,15 @@ func TestUsageReportConversionToDBUsageRecords(t *testing.T) {
200
201
AttributionID : teamAttributionID ,
201
202
StartedAt : creationTime .Time (),
202
203
StoppedAt : sql.NullTime {},
203
- CreditsUsed : 0 ,
204
+ CreditsUsed : 470 ,
204
205
GenerationId : 0 ,
205
206
}},
206
207
},
207
208
}
208
209
209
210
for _ , s := range scenarios {
210
211
t .Run (s .Name , func (t * testing.T ) {
211
- actual := usageReportToUsageRecords (s .Report )
212
+ actual := usageReportToUsageRecords (s .Report , DefaultWorkspacePricer , maxStopTime )
212
213
require .Equal (t , s .Expected , actual )
213
214
})
214
215
}
0 commit comments