Write tests by continuing the pattern of creating mock reference objects. Ideally try and improve the creation of these so that it makes a little more sense.
We decided in a meeting on 12-12-2019 that this is a good compromise compared to trying to do the rewrite now.
Old Ticket contents:
We couldn't really test this well because mocking all of the wikibase-data-model entities was tricky and really we think it should probably be done with real instances of the wikibase-datamodel.
Sadly these can't just be imported and instantiated without refactoring of the upstream library e.g. to either include or eliminate the need for the $.extends or util.inherit