Skip to content

Commit

Permalink
Merge 6b395fc into 9b87047
Browse files Browse the repository at this point in the history
  • Loading branch information
curbengh committed Aug 4, 2019
2 parents 9b87047 + 6b395fc commit 498d449
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
12 changes: 6 additions & 6 deletions test/scripts/tags/asset_img.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,27 @@ describe('asset_img', () => {
}));

it('default', () => {
assetImg('bar').should.eql('<img src="/foo/bar">');
assetImg('bar').should.eql('<img src="/foo/bar" class="">');
});

it('default', () => {
assetImg('bar title').should.eql('<img src="/foo/bar" title="title">');
assetImg('bar title').should.eql('<img src="/foo/bar" class="" title="title">');
});

it('with space', () => {
// {% asset_img "spaced asset" "spaced title" %}
assetImgTag.call(post, ['spaced asset', 'spaced title'])
.should.eql('<img src="/foo/spaced%20asset" title="spaced title">');
.should.eql('<img src="/foo/spaced%20asset" class="" title="spaced title">');
});

it('with alt and title', () => {
assetImgTag.call(post, ['bar', '"title"', '"alt"'])
.should.eql('<img src="/foo/bar" title="title" alt="alt">');
.should.eql('<img src="/foo/bar" class="" title="title" alt="alt">');
});

it('with width height alt and title', () => {
assetImgTag.call(post, ['bar', '100', '200', '"title"', '"alt"'])
.should.eql('<img src="/foo/bar" width="100" height="200" title="title" alt="alt">');
.should.eql('<img src="/foo/bar" class="" width="100" height="200" title="title" alt="alt">');
});

it('no slug', () => {
Expand All @@ -70,6 +70,6 @@ describe('asset_img', () => {

it('with root path', () => {
hexo.config.root = '/root/';
assetImg('bar').should.eql('<img src="/root/foo/bar">');
assetImg('bar').should.eql('<img src="/root/foo/bar" class="">');
});
});
5 changes: 3 additions & 2 deletions test/scripts/tags/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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');
});
});

0 comments on commit 498d449

Please sign in to comment.