linkExternal.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import t from 'tap';
  2. import {testContentFunctions} from '#test-lib';
  3. testContentFunctions(t, 'linkExternal (snapshot)', async (t, evaluate) => {
  4. await evaluate.load();
  5. evaluate.snapshot('missing domain (arbitrary local path)', {
  6. name: 'linkExternal',
  7. args: ['/foo/bar/baz.mp3']
  8. });
  9. evaluate.snapshot('unknown domain (arbitrary world wide web path)', {
  10. name: 'linkExternal',
  11. args: ['https://snoo.ping.as/usual/i/see/'],
  12. });
  13. evaluate.snapshot('basic domain matches', {
  14. name: 'linkExternal',
  15. multiple: [
  16. {args: ['https://homestuck.bandcamp.com/']},
  17. {args: ['https://soundcloud.com/plazmataz']},
  18. {args: ['https://aeritus.tumblr.com/']},
  19. {args: ['https://twitter.com/awkwarddoesart']},
  20. {args: ['https://www.deviantart.com/chesswanderlust-sama']},
  21. {args: ['https://en.wikipedia.org/wiki/Haydn_Quartet_(vocal_ensemble)']},
  22. {args: ['https://www.poetryfoundation.org/poets/christina-rossetti']},
  23. {args: ['https://www.instagram.com/levc_egm/']},
  24. {args: ['https://www.patreon.com/CecilyRenns']},
  25. {args: ['https://open.spotify.com/artist/63SNNpNOicDzG3LY82G4q3']},
  26. {args: ['https://buzinkai.newgrounds.com/']},
  27. ],
  28. });
  29. evaluate.snapshot('custom matches - album', {
  30. name: 'linkExternal',
  31. multiple: [
  32. {args: ['https://youtu.be/abc']},
  33. {args: ['https://youtube.com/watch?v=abc']},
  34. {args: ['https://youtube.com/Playlist?list=kweh']},
  35. ],
  36. slots: {
  37. mode: 'album',
  38. },
  39. });
  40. evaluate.snapshot('custom domains for common platforms', {
  41. name: 'linkExternal',
  42. multiple: [
  43. // Just one domain of each platform is OK here
  44. {args: ['https://music.solatrus.com/']},
  45. {args: ['https://types.pl/']},
  46. ],
  47. });
  48. });