Skip to content

Commit ec3e554

Browse files
committed
Added tests for metadata presence in middleware.
1 parent 1e21928 commit ec3e554

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/client/submit.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,12 @@ module.exports = function() {
13781378

13791379
thisConnection.doc = docs[thisConnection.__test_id] = thisConnection.get('dogs', 'fido');
13801380

1381-
thisConnection.doc.on('op', function() {
1381+
thisConnection.doc.on('op', function(op, source, src, context) {
1382+
if (!src) { // If I am the source there is no metadata to check
1383+
return doneAfter();
1384+
}
1385+
var id = op[0].p[0].split(' ')[1];
1386+
expect(context.op.m).eql(metadatas[id]);
13821387
doneAfter();
13831388
});
13841389

0 commit comments

Comments
 (0)