Skip to content

Commit

Permalink
test(link_tag): urls now have trailing slash
Browse files Browse the repository at this point in the history
  • Loading branch information
curbengh committed Sep 20, 2019
1 parent a241cc1 commit fffafac
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/scripts/tags/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ describe('link', () => {
it('text + url', () => {
const $ = cheerio.load(link('Click here to Google https://google.com'.split(' ')));

$('a').attr('href').should.eql('https://google.com');
$('a').attr('href').should.eql('https://google.com/');
$('a').html().should.eql('Click here to Google');
});

it('text + url + external', () => {
let $ = cheerio.load(link('Click here to Google https://google.com true'.split(' ')));

$('a').attr('href').should.eql('https://google.com');
$('a').attr('href').should.eql('https://google.com/');
$('a').html().should.eql('Click here to Google');
$('a').attr('target').should.eql('_blank');

$ = cheerio.load(link('Click here to Google https://google.com false'.split(' ')));

$('a').attr('href').should.eql('https://google.com');
$('a').attr('href').should.eql('https://google.com/');
$('a').html().should.eql('Click here to Google');
$('a').attr('title').should.eql('');
$('a').attr('target').should.eql('');
Expand All @@ -30,22 +30,22 @@ describe('link', () => {
it('text + url + title', () => {
const $ = cheerio.load(link('Click here to Google https://google.com Google link'.split(' ')));

$('a').attr('href').should.eql('https://google.com');
$('a').attr('href').should.eql('https://google.com/');
$('a').html().should.eql('Click here to Google');
$('a').attr('title').should.eql('Google link');
});

it('text + url + external + title', () => {
let $ = cheerio.load(link('Click here to Google https://google.com true Google link'.split(' ')));

$('a').attr('href').should.eql('https://google.com');
$('a').attr('href').should.eql('https://google.com/');
$('a').html().should.eql('Click here to Google');
$('a').attr('target').should.eql('_blank');
$('a').attr('title').should.eql('Google link');

$ = cheerio.load(link('Click here to Google https://google.com false Google link'.split(' ')));

$('a').attr('href').should.eql('https://google.com');
$('a').attr('href').should.eql('https://google.com/');
$('a').html().should.eql('Click here to Google');
$('a').attr('target').should.eql('');
$('a').attr('title').should.eql('Google link');
Expand Down

0 comments on commit fffafac

Please sign in to comment.