Commit 34f6950f authored by Robert Knight's avatar Robert Knight

Eliminate extra reference to Annotation domain object

As a step towards making <annotation> stateless or nearly-stateless and
instead just a display of an annotation derived from the current
annotation instance and its draft, remove the `domainModel` copy of
`vm.annotation`.
parent e25710c9
This diff is collapsed.
...@@ -1154,16 +1154,14 @@ describe('annotation', function() { ...@@ -1154,16 +1154,14 @@ describe('annotation', function() {
}); });
it('reverts to the most recently saved version', function () { it('reverts to the most recently saved version', function () {
fakeStore.annotation.update = function (params, ann) {
return Promise.resolve(Object.assign({}, ann));
};
var controller = createDirective({ var controller = createDirective({
id: 'new-annot', id: 'new-annot',
user: 'acct:bill@localhost', user: 'acct:bill@localhost',
text: 'saved-text',
}).controller; }).controller;
controller.edit(); controller.edit();
controller.form.text = 'New annotation text'; controller.form.text = 'New annotation text';
return controller.save().then(function () { return controller.save().then(function () {
controller.edit(); controller.edit();
controller.form.text = 'Updated annotation text'; controller.form.text = 'Updated annotation text';
...@@ -1171,7 +1169,7 @@ describe('annotation', function() { ...@@ -1171,7 +1169,7 @@ describe('annotation', function() {
}).then(function () { }).then(function () {
controller.edit(); controller.edit();
controller.revert(); controller.revert();
assert.equal(controller.form.text, 'Updated annotation text'); assert.equal(controller.form.text, controller.annotation.text);
}); });
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment