Skip to content

Commit c1abc4d

Browse files
akashrdevdr497
authored andcommitted
Fix: Tests, remove tests with often changing wallet variables
1 parent 3e5b906 commit c1abc4d

7 files changed

+14
-81
lines changed

js/tests/burn.test.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
require("dotenv").config();
2-
import { test, jest } from "@jest/globals";
2+
import { test, jest, expect } from "@jest/globals";
33
import { Connection, PublicKey, Transaction } from "@solana/web3.js";
44
import { burnDomain } from "../src/bindings/burnDomain";
55

66
jest.setTimeout(20_000);
77

88
const connection = new Connection(process.env.RPC_URL!);
99

10-
const OWNER = new PublicKey("3Wnd5Df69KitZfUoPYZU438eFRNwGHkhLnSAWL65PxJX");
10+
const OWNER = new PublicKey("HKKp49qGWXd639QsuH7JiLijfVW5UtCVY4s1n2HANwEA");
11+
12+
const BURN_DST = new PublicKey("3Wnd5Df69KitZfUoPYZU438eFRNwGHkhLnSAWL65PxJX");
1113

1214
test("Burn", async () => {
1315
const tx = new Transaction();
14-
const ix = burnDomain("1automotive", OWNER, OWNER);
16+
const ix = burnDomain("bonfida", OWNER, BURN_DST);
1517
tx.add(ix);
1618
const { blockhash } = await connection.getLatestBlockhash();
1719
tx.recentBlockhash = blockhash;

js/tests/favorite.test.ts

-12
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ test("Favorite domain", async () => {
3030
stale: false,
3131
},
3232
},
33-
{
34-
user: new PublicKey("A41TAGFpQkFpJidLwH37ydunE7Q3jpBaS228RkoXiRQk"),
35-
favorite: {
36-
domain: new PublicKey("BaQq8Uib3Aw5SPBedC8MdYCvpfEC9iLkUMHc5M74sAjv"),
37-
reverse: "1.00728",
38-
stale: false,
39-
},
40-
},
4133
];
4234
for (let item of items) {
4335
const fav = await getFavoriteDomain(connection, item.user);
@@ -67,10 +59,6 @@ test("Multiple favorite domains", async () => {
6759
wallet: new PublicKey("36Dn3RWhB8x4c83W6ebQ2C2eH9sh5bQX2nMdkP2cWaA4"),
6860
domain: "fav-tokenized",
6961
},
70-
{
71-
wallet: new PublicKey("A41TAGFpQkFpJidLwH37ydunE7Q3jpBaS228RkoXiRQk"),
72-
domain: "1.00728",
73-
},
7462
];
7563
const result = await getMultipleFavoriteDomains(
7664
connection,

js/tests/nft.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require("dotenv").config();
2-
import { test, jest } from "@jest/globals";
2+
import { test, jest, expect, describe } from "@jest/globals";
33
import { PublicKey, Connection } from "@solana/web3.js";
44
import { getDomainKeySync } from "../src/utils/getDomainKeySync";
55
import { getTokenizedDomains } from "../src/utils/getTokenizedDomains";

js/tests/pyth.test.ts

-57
This file was deleted.

js/tests/records-v2.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require("dotenv").config();
2-
import { test, expect } from "@jest/globals";
2+
import { test, expect, jest, describe } from "@jest/globals";
33
import { deserializeRecordV2Content } from "../src/record_v2/deserializeRecordV2Content";
44
import { getMultipleRecordsV2 } from "../src/record_v2/getMultipleRecordsV2";
55
import { getRecordV2 } from "../src/record_v2/getRecordV2";

js/tests/registration.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require("dotenv").config();
2-
import { test, jest } from "@jest/globals";
2+
import { test, jest, expect } from "@jest/globals";
33
import { Connection, PublicKey, Transaction } from "@solana/web3.js";
44
import { registerDomainNameV2 } from "../src/bindings/registerDomainNameV2";
55
import { registerWithNft } from "../src/bindings/registerWithNft";

js/tests/sub.test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require("dotenv").config();
2-
import { test, jest } from "@jest/globals";
2+
import { test, jest, expect } from "@jest/globals";
33
import { Connection, PublicKey, Transaction } from "@solana/web3.js";
44
import { createSubdomain } from "../src/bindings/createSubdomain";
55
import { transferSubdomain } from "../src/bindings/transferSubdomain";
@@ -31,13 +31,13 @@ test("Create sub", async () => {
3131

3232
test("Transfer sub", async () => {
3333
let tx = new Transaction();
34-
const owner = new PublicKey("A41TAGFpQkFpJidLwH37ydunE7Q3jpBaS228RkoXiRQk");
34+
const owner = new PublicKey("HKKp49qGWXd639QsuH7JiLijfVW5UtCVY4s1n2HANwEA");
3535
const parentOwner = new PublicKey(
36-
"A41TAGFpQkFpJidLwH37ydunE7Q3jpBaS228RkoXiRQk",
36+
"HKKp49qGWXd639QsuH7JiLijfVW5UtCVY4s1n2HANwEA",
3737
);
3838
let ix = await transferSubdomain(
3939
connection,
40-
"test.0x33.sol",
40+
"test.bonfida.sol",
4141
PublicKey.default,
4242
false,
4343
);
@@ -66,9 +66,9 @@ test("Transfer sub", async () => {
6666
test("Find sub domain", async () => {
6767
const subs = await findSubdomains(
6868
connection,
69-
getDomainKeySync("bonfida").pubkey,
69+
getDomainKeySync("67679").pubkey,
7070
);
71-
const expectedSub = ["dex", "naming", "test"];
71+
const expectedSub = ["booya", "bullish", "hollaaa", "testing"];
7272
subs.sort().forEach((e, idx) => expect(e).toBe(expectedSub[idx]));
7373
});
7474

0 commit comments

Comments
 (0)