Skip to content

Commit

Permalink
A few more tests for #253
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Oct 23, 2024
1 parent 81cb970 commit bd12818
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions test/transform-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,40 @@ test("Transform image file with diacritics #253", async t => {
}
});

let results = await elev.toJSON();
t.is(normalizeEscapedPaths(results[0].content), `<img src="/virtual/KkPMmHd3hP-1280.jpeg" alt="My ugly mug" width="1280" height="853">`);
});

test("Transform image file in folder with diacritics #253", async t => {
let elev = new Eleventy( "test", "test/_site", {
config: eleventyConfig => {
// Broken: 20240705.île-de-myst-en-lego
// Working: 20240705.île-de-myst-en-lego
eleventyConfig.addTemplate("virtual.html", `<img src="./20240705.île-de-myst-en-lego/les sous titres automatisés de youtube.jpg" alt="My ugly mug">`);
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
formats: ["auto"],
dryRun: true, // don’t write image files!
defaultAttributes: {}
});
}
});

let results = await elev.toJSON();
t.is(normalizeEscapedPaths(results[0].content), `<img src="/virtual/KkPMmHd3hP-1280.jpeg" alt="My ugly mug" width="1280" height="853">`);
});

test("Transform image file in folder with *combining* diacritics #253", async t => {
let elev = new Eleventy( "test", "test/_site", {
config: eleventyConfig => {
eleventyConfig.addTemplate("virtual.html", `<img src="./île-de-myst-en-lego/les sous titres automatisés de youtube.jpg" alt="My ugly mug">`);
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
formats: ["auto"],
dryRun: true, // don’t write image files!
defaultAttributes: {}
});
}
});

let results = await elev.toJSON();
t.is(normalizeEscapedPaths(results[0].content), `<img src="/virtual/KkPMmHd3hP-1280.jpeg" alt="My ugly mug" width="1280" height="853">`);
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bd12818

Please sign in to comment.