From 4e6f3c16818d9beb200c337d48c8ae2470a322ee Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 26 Mar 2023 08:42:14 -0300 Subject: data steps: linkTemplate snapshot tests --- test/snapshots/linkTemplate.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/snapshots/linkTemplate.js (limited to 'test') diff --git a/test/snapshots/linkTemplate.js b/test/snapshots/linkTemplate.js new file mode 100644 index 00000000..0dcf5b61 --- /dev/null +++ b/test/snapshots/linkTemplate.js @@ -0,0 +1,28 @@ +import t from 'tap'; + +import {testContentFunctions} from './_support.js'; + +testContentFunctions(t, 'linkTemplate', (t, evaluate) => { + evaluate.snapshot({ + name: 'linkTemplate', + extraDependencies: { + getColors: c => ({primary: c + 'ff', dim: c + '77'}), + }, + }, + v => v + .slot('color', '#123456') + .slot('href', 'https://hsmusic.wiki/media/cool file.pdf') + .slot('hash', 'fooey') + .slot('attributes', {class: 'dog', id: 'cat1'}) + .slot('content', 'My Cool Link')); + + evaluate.snapshot({ + name: 'linkTemplate', + extraDependencies: { + to: (...path) => '/c*lzone/' + path.join('/') + '/', + appendIndexHTML: true, + }, + }, + v => v + .slot('path', ['myCoolPath', 'ham', 'pineapple', 'tomato'])); +}); -- cgit 1.3.0-6-gf8a5