« get me outta code hell

test: use "native" slots shorthand instead of postprocess - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test/snapshot/image.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-06-13 12:37:18 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-06-13 12:37:18 -0300
commit2ce5ddd844603b1c3d8f220a12603677104b7545 (patch)
tree1e3dc0183cd86c8dfc7e83336af7ae61e874bf04 /test/snapshot/image.js
parentf8d1e6ee6e27e5539d50191b94a79d1fcb797939 (diff)
test: use "native" slots shorthand instead of postprocess
Diffstat (limited to 'test/snapshot/image.js')
-rw-r--r--test/snapshot/image.js83
1 files changed, 46 insertions, 37 deletions
diff --git a/test/snapshot/image.js b/test/snapshot/image.js
index eeffb849..62e1cd9a 100644
--- a/test/snapshot/image.js
+++ b/test/snapshot/image.js
@@ -14,68 +14,77 @@ testContentFunctions(t, 'image (snapshot)', async (t, evaluate) => {
     });
 
   quickSnapshot('source via path', {
-    postprocess: template => template
-      .slot('path', ['media.albumCover', 'beyond-canon', 'png']),
+    slots: {
+      path: ['media.albumCover', 'beyond-canon', 'png'],
+    },
   });
 
   quickSnapshot('source via src', {
-    postprocess: template => template
-      .slot('src', 'https://example.com/bananas.gif'),
+    slots: {
+      src: 'https://example.com/bananas.gif',
+    },
   });
 
   quickSnapshot('source missing', {
-    postprocess: template => template
-      .slot('missingSourceContent', 'Example of missing source message.'),
+    slots: {
+      missingSourceContent: 'Example of missing source message.',
+    },
   });
 
   quickSnapshot('id without link', {
-    postprocess: template => template
-      .slot('src', 'foobar')
-      .slot('id', 'banana'),
+    slots: {
+      src: 'foobar',
+      id: 'banana',
+    },
   });
 
   quickSnapshot('id with link', {
-    postprocess: template => template
-      .slot('src', 'foobar')
-      .slot('link', true)
-      .slot('id', 'banana'),
+    slots: {
+      src: 'foobar',
+      link: true,
+      id: 'banana',
+    },
   });
 
   quickSnapshot('id with square', {
-    postprocess: template => template
-      .slot('src', 'foobar')
-      .slot('square', true)
-      .slot('id', 'banana'),
-  })
+    slots: {
+      src: 'foobar',
+      square: true,
+      id: 'banana',
+    },
+  });
 
   quickSnapshot('width & height', {
-    postprocess: template => template
-      .slot('src', 'foobar')
-      .slot('width', 600)
-      .slot('height', 400),
+    slots: {
+      src: 'foobar',
+      width: 600,
+      height: 400,
+    },
   });
 
   quickSnapshot('square', {
-    postprocess: template => template
-      .slot('src', 'foobar')
-      .slot('square', true),
+    slots: {
+      src: 'foobar',
+      square: true,
+    },
   });
 
   quickSnapshot('lazy with square', {
-    postprocess: template => template
-      .slot('src', 'foobar')
-      .slot('lazy', true)
-      .slot('square', true),
+    slots: {
+      src: 'foobar',
+      lazy: true,
+      square: true,
+    },
   });
 
   quickSnapshot('link with file size', {
     extraDependencies: {
       getSizeOfImageFile: () => 10 ** 6,
     },
-
-    postprocess: template => template
-      .slot('path', ['media.albumCover', 'pingas', 'png'])
-      .slot('link', true),
+    slots: {
+      path: ['media.albumCover', 'pingas', 'png'],
+      link: true,
+    },
   });
 
   quickSnapshot('content warnings via tags', {
@@ -85,8 +94,8 @@ testContentFunctions(t, 'image (snapshot)', async (t, evaluate) => {
         {name: 'too cool for school', isContentWarning: true},
       ],
     ],
-
-    postprocess: template => template
-      .slot('path', ['media.albumCover', 'beyond-canon', 'png']),
-  })
+    slots: {
+      path: ['media.albumCover', 'beyond-canon', 'png'],
+    },
+  });
 });