Add test for visitFields
add test case