Jsa/tnl549

recreated this PR from https://github.com/edx/edx-platform/pull/5559, to base on rc instead.

fixes TNL-549.

there's a dependency on https://github.com/edx/edx-platform/pull/5554 which is not yet merged but addresses a related bug, TNL-606.   There's a workaround condition in one of the tests, which should be removed in whichever PR merges last.

@andy-armstrong @polesye @jmclaus 
@benpatterson FYI
I generally don't like Jasmine tests that call internal methods using spies. I'd rather see the test written to click on the UI the way that a user would, so that it is performing black box testing of the view.