From 6b395fc0b4615695923da992e0d97c669c6d5304 Mon Sep 17 00:00:00 2001 From: curbengh <43627182+curbengh@users.noreply.github.com> Date: Sun, 4 Aug 2019 14:55:19 +0930 Subject: [PATCH] test: allow empty attribute --- test/scripts/tags/asset_img.js | 12 ++++++------ test/scripts/tags/link.js | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/test/scripts/tags/asset_img.js b/test/scripts/tags/asset_img.js index f30049a4f3..1399654176 100644 --- a/test/scripts/tags/asset_img.js +++ b/test/scripts/tags/asset_img.js @@ -37,27 +37,27 @@ describe('asset_img', () => { })); it('default', () => { - assetImg('bar').should.eql(''); + assetImg('bar').should.eql(''); }); it('default', () => { - assetImg('bar title').should.eql(''); + assetImg('bar title').should.eql(''); }); it('with space', () => { // {% asset_img "spaced asset" "spaced title" %} assetImgTag.call(post, ['spaced asset', 'spaced title']) - .should.eql(''); + .should.eql(''); }); it('with alt and title', () => { assetImgTag.call(post, ['bar', '"title"', '"alt"']) - .should.eql('alt'); + .should.eql('alt'); }); it('with width height alt and title', () => { assetImgTag.call(post, ['bar', '100', '200', '"title"', '"alt"']) - .should.eql('alt'); + .should.eql('alt'); }); it('no slug', () => { @@ -70,6 +70,6 @@ describe('asset_img', () => { it('with root path', () => { hexo.config.root = '/root/'; - assetImg('bar').should.eql(''); + assetImg('bar').should.eql(''); }); }); diff --git a/test/scripts/tags/link.js b/test/scripts/tags/link.js index 8e47bef983..07740cceed 100644 --- a/test/scripts/tags/link.js +++ b/test/scripts/tags/link.js @@ -23,7 +23,8 @@ describe('link', () => { $('a').attr('href').should.eql('https://google.com'); $('a').html().should.eql('Click here to Google'); - should.not.exist($('a').attr('target')); + $('a').attr('title').should.eql(''); + $('a').attr('target').should.eql(''); }); it('text + url + title', () => { @@ -46,7 +47,7 @@ describe('link', () => { $('a').attr('href').should.eql('https://google.com'); $('a').html().should.eql('Click here to Google'); - should.not.exist($('a').attr('target')); + $('a').attr('target').should.eql(''); $('a').attr('title').should.eql('Google link'); }); });