generateAdditionalFilesList.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import t from 'tap';
  2. import {testContentFunctions} from '#test-lib';
  3. testContentFunctions(t, 'generateAdditionalFilesList (snapshot)', async (t, evaluate) => {
  4. await evaluate.load();
  5. evaluate.snapshot('no additional files', {
  6. name: 'generateAdditionalFilesList',
  7. args: [[]],
  8. });
  9. evaluate.snapshot('basic behavior', {
  10. name: 'generateAdditionalFilesList',
  11. args: [
  12. [
  13. {
  14. title: 'SBURB Wallpaper',
  15. files: [
  16. 'sburbwp_1280x1024.jpg',
  17. 'sburbwp_1440x900.jpg',
  18. 'sburbwp_1920x1080.jpg',
  19. ],
  20. },
  21. {
  22. title: 'Fake Section',
  23. description: 'Ooo, what happens if there are NO file links provided?',
  24. files: [
  25. 'oops.mp3',
  26. 'Internet Explorer.gif',
  27. 'daisy.mp3',
  28. ],
  29. },
  30. {
  31. title: 'Alternate Covers',
  32. description: 'This is just an example description.',
  33. files: [
  34. 'Homestuck_Vol4_alt1.jpg',
  35. 'Homestuck_Vol4_alt2.jpg',
  36. 'Homestuck_Vol4_alt3.jpg',
  37. ],
  38. },
  39. ],
  40. ],
  41. slots: {
  42. fileLinks: {
  43. 'sburbwp_1280x1024.jpg': 'link to 1280x1024',
  44. 'sburbwp_1440x900.jpg': 'link to 1440x900',
  45. 'sburbwp_1920x1080.jpg': null,
  46. 'Homestuck_Vol4_alt1.jpg': 'link to alt1',
  47. 'Homestuck_Vol4_alt2.jpg': null,
  48. 'Homestuck_Vol4_alt3.jpg': 'link to alt3',
  49. },
  50. fileSizes: {
  51. 'sburbwp_1280x1024.jpg': 2500,
  52. 'sburbwp_1440x900.jpg': null,
  53. 'sburbwp_1920x1080.jpg': null,
  54. 'Internet Explorer.gif': 1,
  55. 'Homestuck_Vol4_alt1.jpg': 1234567,
  56. 'Homestuck_Vol4_alt2.jpg': 1234567,
  57. 'Homestuck_Vol4_alt3.jpg': 1234567,
  58. }
  59. },
  60. });
  61. });