@@ -116,27 +116,25 @@ describe('test NFT auction', () => {
116
116
//TODO: test contents of error message
117
117
return expect ( failedOpeningBid ) . rejects . toHaveProperty ( 'errors' ) ;
118
118
} ) ;
119
- test ( 'place bid meeting opening price and then raise it by valid amount by min_raise_percent' , async ( ) => {
119
+ test ( 'place bid meeting opening price and then raise it by valid amount by min_raise_percent but not min_raise ' , async ( ) => {
120
120
$log . info ( `Alice bids 10tz` ) ;
121
121
const opBid = await nftAuctionAlice . methods . bid ( 0 ) . send ( { amount : 10 } ) ;
122
122
await opBid . confirmation ( ) ;
123
123
$log . info ( `Bid placed. Amount sent: ${ opBid . amount } mutez` ) ;
124
124
125
125
$log . info ( `Eve bids 11tz, a 10% raise of previous bid but less than a 10tz increase` ) ;
126
- const opBid2 = await nftAuctionEve . methods . bid ( 0 ) . send ( { amount : 11 } ) ;
127
- await opBid2 . confirmation ( ) ;
128
- $log . info ( `Bid placed. Amount sent: ${ opBid2 . amount } mutez` ) ;
126
+ const opBid2 = nftAuctionEve . methods . bid ( 0 ) . send ( { amount : 11 } ) ;
127
+ return expect ( opBid2 ) . rejects . toHaveProperty ( 'message' , 'INVALID_BID_AMOUNT' ) ;
129
128
} ) ;
130
- test ( 'place bid meeting opening price and then raise it by valid amount by min_raise' , async ( ) => {
129
+ test ( 'place bid meeting opening price and then raise it by valid amount by min_raise but not min_raise_percent ' , async ( ) => {
131
130
$log . info ( `Alice bids 200tz` ) ;
132
131
const opBid = await nftAuctionAlice . methods . bid ( 0 ) . send ( { amount : 200 } ) ;
133
132
await opBid . confirmation ( ) ;
134
133
$log . info ( `Bid placed. Amount sent: ${ opBid . amount } mutez` ) ;
135
134
136
135
$log . info ( `Eve bids 210tz, a 10tz increase but less than a 10% raise of previous bid ` ) ;
137
- const opBid2 = await nftAuctionEve . methods . bid ( 0 ) . send ( { amount : 210 } ) ;
138
- await opBid2 . confirmation ( ) ;
139
- $log . info ( `Bid placed. Amount sent: ${ opBid2 . amount } mutez` ) ;
136
+ const opBid2 = nftAuctionEve . methods . bid ( 0 ) . send ( { amount : 210 } ) ;
137
+ return expect ( opBid2 ) . rejects . toHaveProperty ( 'message' , 'INVALID_BID_AMOUNT' ) ;
140
138
} ) ;
141
139
test ( 'bid too small should fail' , async ( ) => {
142
140
$log . info ( `Alice bids 20tz` ) ;
0 commit comments