Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 048653d

Browse files
author
Antoine de Chevigné
committedJan 17, 2025·
fix backend tests
1 parent 113e702 commit 048653d

File tree

4 files changed

+8
-172
lines changed

4 files changed

+8
-172
lines changed
 

‎run/tests/api/contracts.test.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,9 @@ describe(`POST ${BASE_URL}/:address/remove`, () => {
475475
describe(`POST ${BASE_URL}/:address/verify`, () => {
476476
it('Should return 200 status code', (done) => {
477477
jest.spyOn(db, 'getPublicExplorerParamsBySlug').mockResolvedValueOnce({ userId: 1, workspaceId: 1 });
478-
jest.spyOn(db, 'getContract').mockResolvedValueOnce({ address: '0x123' });
478+
jest.spyOn(db, 'getContract')
479+
.mockResolvedValueOnce({ address: '0x123' })
480+
.mockResolvedValueOnce({ address: '0x123' });
479481
processContractVerification.mockResolvedValueOnce({ verificationSucceded: true });
480482

481483
request.post(`${BASE_URL}/0x123/verify`)

‎run/tests/api/explorers.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1389,14 +1389,14 @@ describe(`GET ${BASE_URL}/search`, () => {
13891389
it('Should return the correct explorer if this is a base subdomain', (done) => {
13901390
jest.spyOn(db, 'getPublicExplorerParamsBySlug').mockResolvedValueOnce({
13911391
stripeSubscription: { stripePlan: { capabilities: { nativeToken: true }}},
1392-
slug: 'ethernal', name: 'Ethernal Explorer', themes: { default: {}}
1392+
slug: 'ethernal', name: 'Ethernal Explorer', themes: { light: {}}
13931393
});
13941394
request.get(`${BASE_URL}/search?domain=ethernal.ethernal.com`)
13951395
.expect(200)
13961396
.then(({ body }) => {
13971397
expect(body).toEqual({
13981398
explorer: {
1399-
slug: 'ethernal', name: 'Ethernal Explorer', themes: { default: {}}
1399+
slug: 'ethernal', name: 'Ethernal Explorer', themes: { light: {}}
14001400
}
14011401
});
14021402
done();
@@ -1406,14 +1406,14 @@ describe(`GET ${BASE_URL}/search`, () => {
14061406
it('Should return the corresponding explorer when passed a domain', (done) => {
14071407
jest.spyOn(db, 'getPublicExplorerParamsByDomain').mockResolvedValueOnce({
14081408
stripeSubscription: { stripePlan: { capabilities: { nativeToken: true, totalSupply: '1' }}},
1409-
slug: 'ethernal', name: 'Ethernal Explorer', themes: { default: {}}
1409+
slug: 'ethernal', name: 'Ethernal Explorer', themes: { light: {}}
14101410
});
14111411
request.get(`${BASE_URL}/search?domain=explorer.domain.com`)
14121412
.expect(200)
14131413
.then(({ body }) => {
14141414
expect(body).toEqual({
14151415
explorer: {
1416-
slug: 'ethernal', name: 'Ethernal Explorer', themes: { default: {}}
1416+
slug: 'ethernal', name: 'Ethernal Explorer', themes: { light: {}}
14171417
}
14181418
});
14191419
done();

‎run/tests/lib/__snapshots__/abi.test.js.snap

+1-166
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,4 @@
1-
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2-
3-
exports[`decodeLog > Should decode the event if it is anonymous 1`] = `
4-
LogDescription {
5-
"args": [
6-
"0x1cff79cd",
7-
"0xf75fcD9849d3365d436D0CD889Ed500150C9482A",
8-
"0x00000000000000000000000082ecd135dce65fbc6dbdd0e4237e0af93ffd5038",
9-
"0x0000000000000000000000000000000000000000000000000000000000000040",
10-
{
11-
"hex": "0x00",
12-
"type": "BigNumber",
13-
},
14-
"0x1cff79cd00000000000000000000000082ecd135dce65fbc6dbdd0e4237e0af93ffd5038000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a49f6f3d5b0000000000000000000000005ef30b9986345249bc32d8928b7ee64de9435e3900000000000000000000000019c0976f590d67707e62397c87829d896dc0f1f10000000000000000000000009759a6ac90977b93b58547b4a71c78317f391a280000000000000000000000000000000000000000000000000000000000000743000000000000000000000000000000000000000000000cb49b44ba602d80000000000000000000000000000000000000000000000000000000000000",
15-
],
16-
"eventFragment": EventFragment {
17-
"_isFragment": true,
18-
"anonymous": true,
19-
"constructor": [Function],
20-
"format": [Function],
21-
"inputs": [
22-
ParamType {
23-
"_isParamType": true,
24-
"arrayChildren": null,
25-
"arrayLength": null,
26-
"baseType": "bytes4",
27-
"components": null,
28-
"indexed": true,
29-
"name": "sig",
30-
"type": "bytes4",
31-
},
32-
ParamType {
33-
"_isParamType": true,
34-
"arrayChildren": null,
35-
"arrayLength": null,
36-
"baseType": "address",
37-
"components": null,
38-
"indexed": true,
39-
"name": "guy",
40-
"type": "address",
41-
},
42-
ParamType {
43-
"_isParamType": true,
44-
"arrayChildren": null,
45-
"arrayLength": null,
46-
"baseType": "bytes32",
47-
"components": null,
48-
"indexed": true,
49-
"name": "foo",
50-
"type": "bytes32",
51-
},
52-
ParamType {
53-
"_isParamType": true,
54-
"arrayChildren": null,
55-
"arrayLength": null,
56-
"baseType": "bytes32",
57-
"components": null,
58-
"indexed": true,
59-
"name": "bar",
60-
"type": "bytes32",
61-
},
62-
ParamType {
63-
"_isParamType": true,
64-
"arrayChildren": null,
65-
"arrayLength": null,
66-
"baseType": "uint256",
67-
"components": null,
68-
"indexed": false,
69-
"name": "wad",
70-
"type": "uint256",
71-
},
72-
ParamType {
73-
"_isParamType": true,
74-
"arrayChildren": null,
75-
"arrayLength": null,
76-
"baseType": "bytes",
77-
"components": null,
78-
"indexed": false,
79-
"name": "fax",
80-
"type": "bytes",
81-
},
82-
],
83-
"name": "LogNote",
84-
"type": "event",
85-
},
86-
"name": "LogNote",
87-
"signature": "LogNote(bytes4,address,bytes32,bytes32,uint256,bytes)",
88-
"topic": "0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31",
89-
}
90-
`;
91-
92-
exports[`decodeLog > Should decode the event if it is not anonymous 1`] = `
93-
LogDescription {
94-
"args": [
95-
"0xE93381fB4c4F14bDa253907b18faD305D799241a",
96-
"0xc00e94Cb662C3520282E6f5717214004A7f26888",
97-
{
98-
"hex": "0x01",
99-
"type": "BigNumber",
100-
},
101-
],
102-
"eventFragment": EventFragment {
103-
"_isFragment": true,
104-
"anonymous": false,
105-
"constructor": [Function],
106-
"format": [Function],
107-
"inputs": [
108-
ParamType {
109-
"_isParamType": true,
110-
"arrayChildren": null,
111-
"arrayLength": null,
112-
"baseType": "address",
113-
"components": null,
114-
"indexed": true,
115-
"name": "from",
116-
"type": "address",
117-
},
118-
ParamType {
119-
"_isParamType": true,
120-
"arrayChildren": null,
121-
"arrayLength": null,
122-
"baseType": "address",
123-
"components": null,
124-
"indexed": true,
125-
"name": "to",
126-
"type": "address",
127-
},
128-
ParamType {
129-
"_isParamType": true,
130-
"arrayChildren": null,
131-
"arrayLength": null,
132-
"baseType": "uint256",
133-
"components": null,
134-
"indexed": false,
135-
"name": "amount",
136-
"type": "uint256",
137-
},
138-
],
139-
"name": "Transfer",
140-
"type": "event",
141-
},
142-
"name": "Transfer",
143-
"signature": "Transfer(address,address,uint256)",
144-
"topic": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
145-
}
146-
`;
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
1472

1483
exports[`decodeLog Should decode the event if it is anonymous 1`] = `
1494
LogDescription {
@@ -290,26 +145,6 @@ LogDescription {
290145
}
291146
`;
292147

293-
exports[`getTokenTransfer > Should return decoded erc20 transfer 1`] = `
294-
{
295-
"amount": "1",
296-
"dst": "0xc00e94Cb662C3520282E6f5717214004A7f26888",
297-
"src": "0xE93381fB4c4F14bDa253907b18faD305D799241a",
298-
"token": "0xc00e94Cb662C3520282E6f5717214004A7f26888",
299-
"tokenId": null,
300-
}
301-
`;
302-
303-
exports[`getTokenTransfer > Should return decoded erc721 transfer 1`] = `
304-
{
305-
"amount": "1",
306-
"dst": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
307-
"src": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
308-
"token": "0xed5af388653567af2f388e6224dc7c4b3241c544",
309-
"tokenId": "10",
310-
}
311-
`;
312-
313148
exports[`getTokenTransfer Should return decoded erc20 transfer 1`] = `
314149
{
315150
"amount": "1",

‎run/tests/lib/firebase.test.js

-1
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,6 @@ describe('getWorkspaceContracts', () => {
22332233
.then(result => {
22342234
expect(result).toEqual({
22352235
items: [{ id: 10, address: '0x123' }, { id: 11, address: '0xabcd' }],
2236-
total: 2
22372236
});
22382237
done();
22392238
});

0 commit comments

Comments
 (0)
Please sign in to comment.