Overview
The findParamWithAuthentication method in the Condition class has a TODO comment indicating it needs to be fixed and tested. Currently, there are no tests for this method.
Context
Located in packages/taco/src/conditions/condition.ts:42-49:
// TODO: Fix this method and add a test for it
public findParamWithAuthentication(): string | null {
const serialized = toJSON(this.value);
for (const param of USER_ADDRESS_PARAMS) {
if (serialized.includes(param)) {
return param;
}
}
return null;
}
Tasks
- Understand what the method is supposed to do (find user address parameters in conditions)
- Write comprehensive unit tests covering:
- Finding various USER_ADDRESS_PARAMS in conditions
- Returning null when no params are found
- Edge cases with nested conditions
- Fix any issues discovered during testing
- Remove the TODO comment once complete
Files to Change
- Create new test cases in
packages/taco/test/conditions/base/condition.test.ts or appropriate test file
- Update
packages/taco/src/conditions/condition.ts if fixes are needed
Test Cases to Include
Definition of Done
Overview
The
findParamWithAuthenticationmethod in the Condition class has a TODO comment indicating it needs to be fixed and tested. Currently, there are no tests for this method.Context
Located in
packages/taco/src/conditions/condition.ts:42-49:Tasks
Files to Change
packages/taco/test/conditions/base/condition.test.tsor appropriate test filepackages/taco/src/conditions/condition.tsif fixes are neededTest Cases to Include
:userAddress:userAddressExternalWalletDefinition of Done
findParamWithAuthentication