Bug 885678 - Tests for renderUI in keyboard

This adds unit tests around the renderUI code because the regressions that we had earlier this week.