Add tests for map and bg layer selector directives

This PR adds tests for the map and background layer selector directives. It also shows how directives can effectively be tested.