Skip to content

Commit

Permalink
chore: add breaking test for #41
Browse files Browse the repository at this point in the history
  • Loading branch information
carbontwelve committed May 3, 2024
1 parent 608c0a1 commit 10ea08e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/eleventy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test("Sample small Website (wikilinks and regular links)", async t => {

let results = await elev.toJSON();

t.is(results.length, 4);
t.is(results.length, 5);

t.is(
normalize(findResultByUrl(results, '/about/').content),
Expand All @@ -41,6 +41,19 @@ test("Sample small Website (htmlenteties)", async t => {
);
});

test("Sample small Website (alias text used for link)", async t => {
let elev = new Eleventy(fixturePath('sample-small-website'), fixturePath('sample-small-website/_site'), {
configPath: fixturePath('sample-small-website/eleventy.config.js'),
});

let results = await elev.toJSON();

t.is(
normalize(findResultByUrl(results, '/aliased-link-to-lonelyjuly/').content),
`<div><p>This should link with the alias as text <a href="/lonelyjuly/">LonelyJuly</a>.</p></div><div></div>`
);
});

test.serial("Broken page (wikilinks and regular links)", async t => {
const mock = sinon.stub(console, 'warn');

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Aliased Link to LonelyJuly
layout: default.liquid
---

This should link with the alias as text [[LonelyJuly]].

0 comments on commit 10ea08e

Please sign in to comment.