generateAlbumCoverArtwork.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import t from 'tap';
  2. import contentFunction from '#content-function';
  3. import {testContentFunctions} from '#test-lib';
  4. testContentFunctions(t, 'generateAlbumCoverArtwork (snapshot)', async (t, evaluate) => {
  5. await evaluate.load({
  6. mock: {
  7. image: evaluate.stubContentFunction('image'),
  8. },
  9. });
  10. const album = {
  11. directory: 'bee-forus-seatbelt-safebee',
  12. coverArtFileExtension: 'png',
  13. coverArtDimensions: [400, 300],
  14. color: '#f28514',
  15. artTags: [
  16. {name: 'Damara', directory: 'damara', isContentWarning: false},
  17. {name: 'Cronus', directory: 'cronus', isContentWarning: false},
  18. {name: 'Bees', directory: 'bees', isContentWarning: false},
  19. {name: 'creepy crawlies', isContentWarning: true},
  20. ],
  21. };
  22. evaluate.snapshot('display: primary', {
  23. name: 'generateAlbumCoverArtwork',
  24. args: [album],
  25. slots: {mode: 'primary'},
  26. });
  27. evaluate.snapshot('display: thumbnail', {
  28. name: 'generateAlbumCoverArtwork',
  29. args: [album],
  30. slots: {mode: 'thumbnail'},
  31. });
  32. });