File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -754,6 +754,7 @@ export enum CreditType {
754754 REPLAY = 'replay' ,
755755 DISCOUNT = 'discount' ,
756756 PERCENT = 'percent' ,
757+ LOG_BYTE = 'log_byte' ,
757758}
758759
759760type BaseRecurringCredit = {
@@ -783,7 +784,8 @@ interface RecurringEventCredit extends BaseRecurringCredit {
783784 | CreditType . PROFILE_DURATION
784785 | CreditType . PROFILE_DURATION_UI
785786 | CreditType . ATTACHMENT
786- | CreditType . REPLAY ;
787+ | CreditType . REPLAY
788+ | CreditType . LOG_BYTE ;
787789}
788790
789791export type RecurringCredit =
Original file line number Diff line number Diff line change @@ -206,6 +206,33 @@ describe('Recurring Credits', function () {
206206 expect ( screen . getByTestId ( 'amount' ) ) . toHaveTextContent ( '+3M/mo' ) ;
207207 } ) ;
208208
209+ it ( 'renders log byte recurring credits' , async function ( ) {
210+ MockApiClient . addMockResponse ( {
211+ url : `/customers/${ organization . slug } /recurring-credits/` ,
212+ method : 'GET' ,
213+ body : [
214+ RecurringCreditFixture ( {
215+ id : 1 ,
216+ periodStart : moment ( ) . format ( ) ,
217+ periodEnd : moment ( ) . utc ( ) . add ( 3 , 'months' ) . format ( ) ,
218+ amount : 2.5 ,
219+ type : CreditType . LOG_BYTE ,
220+ totalAmountRemaining : null ,
221+ } ) ,
222+ ] ,
223+ } ) ;
224+
225+ render (
226+ < RecurringCredits displayType = "data" planDetails = { subscription . planDetails } /> ,
227+ { organization}
228+ ) ;
229+
230+ await screen . findByRole ( 'heading' , { name : / r e c u r r i n g c r e d i t s / i} ) ;
231+
232+ expect ( screen . getByText ( 'logBytes' ) ) . toBeInTheDocument ( ) ;
233+ expect ( screen . getByTestId ( 'amount' ) ) . toHaveTextContent ( '+2.5 GB/mo' ) ;
234+ } ) ;
235+
209236 it ( 'renders multiple recurring credits' , async function ( ) {
210237 MockApiClient . addMockResponse ( {
211238 url : `/customers/${ organization . slug } /recurring-credits/` ,
You can’t perform that action at this time.
0 commit comments