File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,27 @@ describe('identity.simple', function () {
22
22
sinon . assert . calledWithMatch ( register , policy , 'identityPolicy' ) ;
23
23
} ) ;
24
24
} ) ;
25
+
26
+ describe ( 'beforeAnnotationCreatedHook' , function ( ) {
27
+ var sandbox ;
28
+
29
+ beforeEach ( function ( ) {
30
+ sandbox = sinon . sandbox . create ( ) ;
31
+ } ) ;
32
+
33
+ afterEach ( function ( ) {
34
+ sandbox . restore ( ) ;
35
+ } ) ;
36
+
37
+ it ( 'sets the user property of the annotation' , function ( ) {
38
+ var policyProto = identity . SimpleIdentityPolicy . prototype ;
39
+ sandbox . stub ( policyProto , 'who' ) . returns ( 'alice' ) ;
40
+
41
+ var annotation = { } ;
42
+ ext . beforeAnnotationCreated ( annotation ) ;
43
+ assert . equal ( annotation . user , 'alice' ) ;
44
+ } ) ;
45
+ } ) ;
25
46
} ) ;
26
47
27
48
describe ( 'identity.SimpleIdentityPolicy' , function ( ) {
You can’t perform that action at this time.
0 commit comments