chore: refactor tests for patching APIs