Commit e389b750 authored by Robert Knight's avatar Robert Knight

Fix annotation ID not being passed to moderation banner correctly.

Add missing `vm.` prefix and test. This was missed when testing the PR
because the banner was enabled by modifying the banner's controller
instead of the app state.
parent 967f89f7
......@@ -25,7 +25,13 @@ function PageObject(element) {
describe('annotationThread', function () {
before(function () {
angular.module('app', [])
.component('annotationThread', annotationThread);
.component('annotationThread', annotationThread)
.component('moderationBanner', {
bindings: {
annotationId: '<',
isReply: '<',
},
});
});
beforeEach(function () {
......@@ -176,4 +182,22 @@ describe('annotationThread', function () {
assert.calledWith(onForceVisible, thread.children[0]);
});
});
it('renders the moderation banner', function () {
var thread = {
id: '123',
parent: null,
children: [],
};
var element = util.createDirective(document, 'annotationThread', {
thread: thread,
});
var moderationBanner = element
.find('moderation-banner')
.controller('moderationBanner');
assert.deepEqual(moderationBanner, {
isReply: false,
annotationId: '123',
});
});
});
......@@ -11,7 +11,7 @@
</div>
<div class="annotation-thread__content">
<moderation-banner is-reply="!vm.isTopLevelThread()"
annotation-id="thread.id">
annotation-id="vm.thread.id">
</moderation-banner>
<annotation ng-class="vm.annotationClasses()"
annotation="vm.thread.annotation"
......
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