Correctly deserialize HTML entities in block DOM

E.g. in variable names
This commit is contained in:
Scimonster 2017-10-09 01:19:55 +03:00
parent e4830dfe51
commit 7afb17df7f
3 changed files with 25 additions and 1 deletions

View file

@ -155,6 +155,24 @@ test('create with obscured shadow', t => {
t.end();
});
test('create variable with entity in name', t => {
const result = adapter(events.createvariablewithentity);
t.ok(Array.isArray(result));
t.equal(result.length, 1);
t.type(result[0].id, 'string');
t.type(result[0].opcode, 'string');
t.type(result[0].fields, 'object');
t.type(result[0].fields.VARIABLE, 'object');
t.type(result[0].fields.VARIABLE.value, 'string');
t.equal(result[0].fields.VARIABLE.value, 'this & that');
t.type(result[0].inputs, 'object');
t.type(result[0].topLevel, 'boolean');
t.equal(result[0].topLevel, true);
t.end();
});
test('create with invalid block xml', t => {
// Entirely invalid block XML
const result = adapter(events.createinvalid);