Skip to content

Commit 34218be

Browse files
authored
TS Integration Tests Rewrite (#44)
* ts int tests
1 parent 2d533d5 commit 34218be

4 files changed

Lines changed: 174 additions & 149 deletions

File tree

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
- name: Install Rust
2121
uses: actions-rs/toolchain@v1
2222
with:
23+
toolchain: 1.61.0
2324
target: wasm32-unknown-unknown
2425
- name: Build smart contract
2526
run: npm run build
@@ -41,6 +42,7 @@ jobs:
4142
- name: Install Rust
4243
uses: actions-rs/toolchain@v1
4344
with:
45+
toolchain: 1.61.0
4446
target: wasm32-unknown-unknown
4547
- name: Build smart contract
4648
run: npm run build

integration-tests/rs/src/tests.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ async fn test_nft_approve_call_long_msg_string(
181181
) -> anyhow::Result<()> {
182182
let token_id = "3";
183183
helpers::mint_nft(user, nft_contract, worker, token_id).await?;
184+
helpers::pay_for_storage(user, market_contract, worker, 10000000000000000000000).await?;
184185

185186
let approve_payload = json!({
186187
"token_id": token_id,
@@ -191,6 +192,7 @@ async fn test_nft_approve_call_long_msg_string(
191192
match user.call(&worker, nft_contract.id(), "nft_approve")
192193
.args_json(approve_payload)?
193194
.deposit(helpers::DEFAULT_DEPOSIT)
195+
.gas(helpers::DEFAULT_GAS as u64)
194196
.transact()
195197
.await
196198
{
@@ -200,7 +202,7 @@ async fn test_nft_approve_call_long_msg_string(
200202
Err(e) => {
201203
let e_string = e.to_string();
202204
if !e_string
203-
.contains("Exceeded the prepaid gas")
205+
.contains("Not valid SaleArgs")
204206
{
205207
panic!("test_nft_approve_call_long_msg_string displays unexpected error message: {:?}", e_string);
206208
}
@@ -216,7 +218,7 @@ async fn test_nft_approve_call_long_msg_string(
216218
.await?
217219
.json()?;
218220

219-
assert_eq!(result, false);
221+
assert_eq!(result, true);
220222
println!(" Passed ✅ test_nft_approve_call_long_msg_string");
221223
}
222224
}

integration-tests/ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.0",
44
"license": "(MIT AND Apache-2.0)",
55
"scripts": {
6-
"test": "ava --verbose"
6+
"test": "ava"
77
},
88
"devDependencies": {
99
"ava": "^4.3.3",

0 commit comments

Comments
 (0)