[view] added layout test, updated code to pass tests