Fix broken JavaScript tests

Update tests to reflect changes made by #798, #765

Also remove a stray debug message.
Merge remote-tracking branch 'origin/develop' into 741-embed_widget