@ -51,7 +51,7 @@ describe('TransactionActivityLog Component', () => {
assert . ok ( wrapper . hasClass ( 'test-class' ) )
} )
it ( 'should render inline retry and cancel buttons' , ( ) => {
it ( 'should render inline retry and cancel buttons for earliest pending transaction ' , ( ) => {
const activities = [
{
eventKey : 'transactionCreated' ,
@ -90,6 +90,7 @@ describe('TransactionActivityLog Component', () => {
onCancel = { ( ) => { } }
onRetry = { ( ) => { } }
primaryTransactionStatus = "pending"
isEarliestNonce = { true }
/ > ,
{ context : { t : ( str1 , str2 ) => str2 ? str1 + str2 : str1 } }
)
@ -98,4 +99,53 @@ describe('TransactionActivityLog Component', () => {
assert . ok ( wrapper . hasClass ( 'test-class' ) )
assert . equal ( wrapper . find ( '.transaction-activity-log__action-link' ) . length , 2 )
} )
it ( 'should not render inline retry and cancel buttons for newer pending transactions' , ( ) => {
const activities = [
{
eventKey : 'transactionCreated' ,
hash : '0xa' ,
id : 1 ,
timestamp : 1 ,
value : '0x1' ,
} , {
eventKey : 'transactionSubmitted' ,
hash : '0xa' ,
id : 1 ,
timestamp : 2 ,
value : '0x1' ,
} , {
eventKey : 'transactionResubmitted' ,
hash : '0x7d09d337fc6f5d6fe2dbf3a6988d69532deb0a82b665f9180b5a20db377eea87' ,
id : 2 ,
timestamp : 3 ,
value : '0x1' ,
} , {
eventKey : 'transactionCancelAttempted' ,
hash : '0x7d09d337fc6f5d6fe2dbf3a6988d69532deb0a82b665f9180b5a20db377eea87' ,
id : 3 ,
timestamp : 4 ,
value : '0x1' ,
} ,
]
const wrapper = shallow (
< TransactionActivityLog
activities = { activities }
className = "test-class"
inlineRetryIndex = { 2 }
inlineCancelIndex = { 3 }
nativeCurrency = "ETH"
onCancel = { ( ) => { } }
onRetry = { ( ) => { } }
primaryTransactionStatus = "pending"
isEarliestNonce = { false }
/ > ,
{ context : { t : ( str1 , str2 ) => str2 ? str1 + str2 : str1 } }
)
assert . ok ( wrapper . hasClass ( 'transaction-activity-log' ) )
assert . ok ( wrapper . hasClass ( 'test-class' ) )
assert . equal ( wrapper . find ( '.transaction-activity-log__action-link' ) . length , 0 )
} )
} )