@@ -110,7 +110,14 @@ describe("QueueHandler", function () {
110
110
const { queueHandler, distributionQueue } = await loadFixture ( deployFixture ) ;
111
111
112
112
await distributionQueue . addDistribution ( "HIN" , "fbc880caac090c43" ) ;
113
+
114
+ const distributionQueueLengthBefore = await distributionQueue . getLength ( ) ;
115
+ expect ( distributionQueueLengthBefore ) . to . equal ( 1 ) ;
116
+
113
117
await expect ( queueHandler . processQueuePair ( ) ) . to . be . rejectedWith ( "The distribution must first be approved/rejected" ) ;
118
+
119
+ const distributionQueueLengthAfter = await distributionQueue . getLength ( ) ;
120
+ expect ( distributionQueueLengthAfter ) . to . equal ( 1 ) ;
114
121
} ) ;
115
122
116
123
it ( "Transaction should be processed if distribution has 1 approval, 0 rejections" , async function ( ) {
@@ -120,10 +127,20 @@ describe("QueueHandler", function () {
120
127
await distributionVerifier . verifyDistribution ( 1 , true ) ;
121
128
122
129
await sponsorshipQueue . addSponsorship ( "HIN" , { value : hre . ethers . parseUnits ( "0.02" ) } ) ;
130
+
131
+ const distributionQueueLengthBefore = await distributionQueue . getLength ( ) ;
132
+ expect ( distributionQueueLengthBefore ) . to . equal ( 1 ) ;
123
133
134
+ const sponsorshipQueueLengthBefore = await sponsorshipQueue . getLength ( ) ;
135
+ expect ( sponsorshipQueueLengthBefore ) . to . equal ( 1 ) ;
136
+
124
137
await queueHandler . processQueuePair ( ) ;
125
- } ) ;
126
138
127
- // TODO: test dequeue
139
+ const distributionQueueLengthAfter = await distributionQueue . getLength ( ) ;
140
+ expect ( distributionQueueLengthAfter ) . to . equal ( 0 ) ;
141
+
142
+ const sponsorshipQueueLengthAfter = await sponsorshipQueue . getLength ( ) ;
143
+ expect ( sponsorshipQueueLengthAfter ) . to . equal ( 0 ) ;
144
+ } ) ;
128
145
} ) ;
129
146
} ) ;
0 commit comments