fixed element reference in tests
refactored new mock app factory