You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test should correctly create the ACC in packages/wrapped-keys/src/lib/api/utils.spec.ts expects an array with a single ACC object, but the actual getPkpAccessControlCondition function returns a plain object (not an array). This causes:
FAIL types packages/wrapped-keys/src/lib/api/utils.spec.ts
● getPkpAccessControlCondition › should correctly create the ACC
expect(received).toEqual(expected) // deep equality
Expected: [{"chain": "ethereum", "contractAddress": "", "method": "", "parameters": [":userAddress"], "returnValueTest": {"comparator": "=", "value": "0xd1Af1AAC50aC837C873200D17b78664aFCde597C"}, "standardContractType": ""}]
Received: {"chain": "ethereum", "contractAddress": "", "method": "", "parameters": [":userAddress"], "returnValueTest": {"comparator": "=", "value": "0xd1Af1AAC50aC837C873200D17b78664aFCde597C"}, "standardContractType": ""}
88 | const pkpAddress = '0xd1Af1AAC50aC837C873200D17b78664aFCde597C';
89 | const acc = getPkpAccessControlCondition(pkpAddress);> 90 | expect(acc).toEqual([
| ^
91 | {
92 | contractAddress: '',
93 | standardContractType: '',
at Object.<anonymous> (src/lib/api/utils.spec.ts:90:17)
Test Suites: 1 failed, 1 passed, 2 total
Tests: 1 failed, 12 passed, 13 total
Snapshots: 0 total
Time: 2.563 s
Ran all test suites.
Severity of the bug
This breaks the test suite out-of-the-box, causing CI to fail unless the code or test is adjusted.
Steps To Reproduce
npx nx run wrapped-keys:test
The test fails with the mismatch: expected array vs actual object.
Is there an existing issue for this?
SDK version
Using Lit JS SDK (master branch commit 412264b.)
Lit Network
This issue is for unit testing , so not
Description of the bug/issue
The test
should correctly create the ACC
inpackages/wrapped-keys/src/lib/api/utils.spec.ts
expects an array with a single ACC object, but the actualgetPkpAccessControlCondition
function returns a plain object (not an array). This causes:Severity of the bug
This breaks the test suite out-of-the-box, causing CI to fail unless the code or test is adjusted.
Steps To Reproduce
npx nx run wrapped-keys:test
Link to code
Anything else?
Proposed fix:
getPkpAccessControlCondition
to return an array (like[ {...} ]
), or modify the test to expect an object.The text was updated successfully, but these errors were encountered: