Make sure to set comment property of block when creating a new block via XML using the adapter. Update unit tests.

This commit is contained in:
Karishma Chadha 2018-06-15 13:58:03 -04:00
parent 29b79878bc
commit 76b423e481
3 changed files with 33 additions and 0 deletions

View file

@ -24,6 +24,7 @@ test('create event', t => {
// Outer block
t.type(result[0].id, 'string');
t.type(result[0].opcode, 'string');
t.type(result[0].comment, 'undefined');
t.type(result[0].fields, 'object');
t.type(result[0].inputs, 'object');
t.type(result[0].inputs.DURATION, 'object');
@ -43,6 +44,20 @@ test('create event', t => {
t.end();
});
test('create with comment', t => {
const result = adapter(events.createComment);
// This test should be the same as above except that it also has a comment.
t.ok(Array.isArray(result));
t.equal(result.length, 2);
t.type(result[0].comment, 'string');
t.equal(result[0].comment, 'aCommentId');
t.end();
});
test('create with branch', t => {
const result = adapter(events.createbranch);
// Outer block