Skip to content

Commit 27d6447

Browse files
fix(types): add grantedAccess property to test contact objects
- Add grantedAccess mock data to all test contact objects - Update test expectations to include grantedAccess property - Fix TypeScript errors in subgraphQuery.test.ts
1 parent ca4510c commit 27d6447

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/unit/utils/subgraphQuery.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ describe('getValidContact', () => {
1313

1414
beforeAll(() => {
1515
// Initialize the variables in the beforeAll hook
16+
const mockGrantedAccess = {
17+
dataset: '0x0000000000000000000000000000000000000000',
18+
datasetprice: '0',
19+
volume: '1',
20+
tag: '0x0000000000000000000000000000000000000000000000000000000000000000',
21+
apprestrict: '0x0000000000000000000000000000000000000000',
22+
workerpoolrestrict: '0x0000000000000000000000000000000000000000',
23+
requesterrestrict: '0x0000000000000000000000000000000000000000',
24+
salt: '0x0000000000000000000000000000000000000000000000000000000000000000',
25+
sign: '0x0000000000000000000000000000000000000000000000000000000000000000',
26+
remainingAccess: 1,
27+
};
1628
contacts = [
1729
{
1830
address: 'address1',
@@ -21,6 +33,7 @@ describe('getValidContact', () => {
2133
remainingAccess: 1,
2234
accessPrice: 0,
2335
isUserStrict: true,
36+
grantedAccess: mockGrantedAccess,
2437
},
2538
{
2639
address: 'address2',
@@ -29,6 +42,7 @@ describe('getValidContact', () => {
2942
remainingAccess: 1,
3043
accessPrice: 0,
3144
isUserStrict: true,
45+
grantedAccess: mockGrantedAccess,
3246
},
3347
{
3448
address: 'address3',
@@ -37,6 +51,7 @@ describe('getValidContact', () => {
3751
remainingAccess: 1,
3852
accessPrice: 0,
3953
isUserStrict: true,
54+
grantedAccess: mockGrantedAccess,
4055
},
4156
];
4257

@@ -64,6 +79,7 @@ describe('getValidContact', () => {
6479
remainingAccess: 1,
6580
accessPrice: 0,
6681
isUserStrict: true,
82+
grantedAccess: contacts[0].grantedAccess,
6783
},
6884
{
6985
address: 'address3',
@@ -73,6 +89,7 @@ describe('getValidContact', () => {
7389
remainingAccess: 1,
7490
accessPrice: 0,
7591
isUserStrict: true,
92+
grantedAccess: contacts[2].grantedAccess,
7693
},
7794
]);
7895

0 commit comments

Comments
 (0)