Change vm.document to vm.document()
vm.document was a variable containing data duplicated from domainModel (not an exact copy, but data extracted from domainModel anyway). It's just easier to have a method for getting this - saves having to manage another variable and update it at the correct times. In making this change I noticed that there were several tests for updateViewModel() that were actually tests for extractDocumentMetadata() (which updateViewModel() was calling). These tests are no longer valud since updateViewModel() no longer calls extractDocumentMetadata(), and there are already duplicate unit tests of extractDocumentMetadata() itself. This leaves the describe('updateViewModel()') empty of tests, and since updateViewModel() is now pretty trivial, I decided just to delete the describe() rather then leave it empty or think up some tests to add to it.
Showing
Please register or sign in to comment