Skip to content

Commit d30c712

Browse files
authored
Merge branch 'staging' into fix-total-calculation
2 parents 449f151 + 106fce3 commit d30c712

File tree

4 files changed

+144
-137
lines changed

4 files changed

+144
-137
lines changed

playwright-tests/tests/settings/create-threshold-request.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,13 @@ test.describe("User is logged in", function () {
345345
await page.getByTestId("dropdown-btn").click();
346346
await page.getByRole("list").getByText("Percentage of members").click();
347347
await thresholdInput.click();
348+
await page.waitForTimeout(200);
348349
await page.keyboard.down("Control");
349350
await page.keyboard.press("A");
350351
await page.keyboard.up("Control");
351352
await page.keyboard.press("Backspace");
352-
await thresholdInput.type("0", { delay: 100 });
353+
await page.waitForTimeout(200);
354+
await thresholdInput.pressSequentially("0", { delay: 100 });
353355
await expect(
354356
page.getByText("The minimum allowed percentage is 1%.")
355357
).toBeVisible({ timeout: 20_000 });

treasury-factory/tests/test_basics.rs

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use cargo_near_build::BuildOpts;
22
use lazy_static::lazy_static;
3-
use near_sdk::base64::prelude::BASE64_STANDARD;
4-
use near_sdk::base64::{engine::general_purpose, Engine as _};
3+
use near_sdk::base64::{engine::general_purpose::STANDARD as BASE64_STANDARD, Engine as _};
54
use near_sdk::serde::Deserialize;
65
use near_sdk::{AccountId, NearToken};
76
use near_workspaces::types::AccessKeyPermission;
@@ -39,7 +38,7 @@ fn create_preload_result(
3938
) -> serde_json::Value {
4039
let preload_url = format!(
4140
"/web4/contract/social.near/get?keys.json=%5B%22{}/widget/app/metadata/**%22%5D",
42-
account_id.as_str()
41+
account_id
4342
);
4443
let body_string = serde_json::json!({account_id:{"widget":{"app":{"metadata":{
4544
"description":description,
@@ -50,10 +49,10 @@ fn create_preload_result(
5049

5150
let body_base64 = BASE64_STANDARD.encode(body_string);
5251
return serde_json::json!({
53-
String::from(preload_url): {
54-
"contentType": "application/json",
55-
"body": body_base64
56-
}
52+
preload_url: {
53+
"contentType": "application/json",
54+
"body": body_base64
55+
}
5756
});
5857
}
5958

@@ -100,8 +99,7 @@ async fn test_web4() -> Result<(), Box<dyn std::error::Error>> {
10099
let response = result.json::<Web4Response>().unwrap();
101100
assert_eq!("text/html; charset=UTF-8", response.content_type);
102101

103-
let body_string =
104-
String::from_utf8(general_purpose::STANDARD.decode(response.body).unwrap()).unwrap();
102+
let body_string = String::from_utf8(BASE64_STANDARD.decode(response.body).unwrap()).unwrap();
105103
assert!(body_string.contains("near-social-viewer"));
106104

107105
Ok(())
@@ -325,7 +323,7 @@ async fn test_factory() -> Result<(), Box<dyn std::error::Error>> {
325323
"social_db_account_id": SOCIALDB_ACCOUNT,
326324
"widget_reference_account_id": WIDGET_REFERENCE_ACCOUNT_ID,
327325
"name": instance_name,
328-
"create_dao_args": general_purpose::STANDARD.encode(create_dao_args.to_string())
326+
"create_dao_args": BASE64_STANDARD.encode(create_dao_args.to_string())
329327
}
330328
))
331329
.max_gas()
@@ -394,8 +392,7 @@ async fn test_factory() -> Result<(), Box<dyn std::error::Error>> {
394392
let response = result.json::<Web4Response>().unwrap();
395393
assert_eq!("text/html; charset=UTF-8", response.content_type);
396394

397-
let body_string =
398-
String::from_utf8(general_purpose::STANDARD.decode(response.body).unwrap()).unwrap();
395+
let body_string = String::from_utf8(BASE64_STANDARD.decode(response.body).unwrap()).unwrap();
399396

400397
assert!(body_string.contains("near-social-viewer"));
401398
assert!(body_string.contains("\"test treasury title\""));
@@ -494,14 +491,14 @@ async fn test_factory() -> Result<(), Box<dyn std::error::Error>> {
494491
let social_metadata_json: Value =
495492
Value::from_str(String::from_utf8(social_metadata.result).unwrap().as_str()).unwrap();
496493
let metadata = &social_metadata_json[instance_account_id.clone()]["widget"]["app"]["metadata"];
497-
assert_eq!(metadata["name"], "NEAR treasury");
494+
assert_eq!(metadata["name"], "NEAR Treasury");
498495
assert_eq!(
499496
metadata["description"],
500-
format!("NEAR treasury for {}", instance_account_id)
497+
format!("NEAR Treasury / {}", instance_account_id)
501498
);
502499
assert_eq!(
503500
metadata["image"]["ipfs_cid"],
504-
"bafkreiboarigt5w26y5jyxyl4au7r2dl76o5lrm2jqjgqpooakck5xsojq"
501+
"bafkreiefdkigadpkpccreqfnhut2li2nmf3alhz7c3wadveconelisnksu"
505502
);
506503

507504
Ok(())
@@ -680,7 +677,7 @@ async fn test_factory_should_refund_if_failing_because_of_existing_account(
680677
"social_db_account_id": SOCIALDB_ACCOUNT,
681678
"widget_reference_account_id": WIDGET_REFERENCE_ACCOUNT_ID,
682679
"name": instance_name,
683-
"create_dao_args": general_purpose::STANDARD.encode(create_dao_args.to_string())
680+
"create_dao_args": BASE64_STANDARD.encode(create_dao_args.to_string())
684681
}
685682
))
686683
.max_gas()
@@ -893,7 +890,7 @@ async fn test_factory_should_refund_if_failing_because_of_existing_dao(
893890
"social_db_account_id": SOCIALDB_ACCOUNT,
894891
"widget_reference_account_id": WIDGET_REFERENCE_ACCOUNT_ID,
895892
"name": instance_name,
896-
"create_dao_args": general_purpose::STANDARD.encode(create_dao_args.to_string())
893+
"create_dao_args": BASE64_STANDARD.encode(create_dao_args.to_string())
897894
}
898895
))
899896
.max_gas()

0 commit comments

Comments
 (0)