Skip to content

Commit

Permalink
Update 51.js test
Browse files Browse the repository at this point in the history
  • Loading branch information
mackignacio committed Aug 29, 2021
1 parent e37dbef commit 87d0b19
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/51.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
const { parse } = require('../dist');

describe.skip('issue 51', function () {
describe('issue 51', function () {
it('vue: > in attibute value', function () {
const html = '<template v-if="list.length>0"> <div> 123 </div> </template>';
// Reference https://github.com/taoqf/node-html-parser/issues/51#issue-636325007
const html = '<template v-if="list.length>0"> <div>123</div> </template>';
const root = parse(html);
root.toString().should.eql(html);
const tpl = root.firstChild;

tpl.getAttribute('v-if').should.eql('list.length>0');
should.equal(tpl.rawAttrs, 'v-if="list.length>0"');
should.equal(tpl.tagName, 'TEMPLATE');

const div = tpl.childNodes[1];
div.textContent.should.eql('123');
console.log(div.textContent);
});
});
});

0 comments on commit 87d0b19

Please sign in to comment.