Refactor viewlet tests