generateAlbumSecondaryNav.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import t from 'tap';
  2. import {testContentFunctions} from '#test-lib';
  3. testContentFunctions(t, 'generateAlbumSecondaryNav (snapshot)', async (t, evaluate) => {
  4. await evaluate.load();
  5. let album, group1, group2;
  6. group1 = {name: 'VCG', directory: 'vcg', color: '#abcdef'};
  7. group2 = {name: 'Bepis', directory: 'bepis', color: '#123456'};
  8. album = {
  9. date: new Date('2010-04-13'),
  10. groups: [group1, group2],
  11. };
  12. group1.albums = [
  13. {name: 'First', directory: 'first', date: new Date('2010-04-10')},
  14. album,
  15. {name: 'Last', directory: 'last', date: new Date('2010-06-12')},
  16. ];
  17. group2.albums = [
  18. album,
  19. {name: 'Second', directory: 'second', date: new Date('2011-04-13')},
  20. ];
  21. evaluate.snapshot('basic behavior, mode: album', {
  22. name: 'generateAlbumSecondaryNav',
  23. args: [album],
  24. slots: {mode: 'album'},
  25. });
  26. evaluate.snapshot('basic behavior, mode: track', {
  27. name: 'generateAlbumSecondaryNav',
  28. args: [album],
  29. slots: {mode: 'track'},
  30. });
  31. album = {
  32. date: null,
  33. groups: [group1, group2],
  34. };
  35. group1.albums = [
  36. ...group1.albums,
  37. album,
  38. ];
  39. evaluate.snapshot('dateless album in mixed group', {
  40. name: 'generateAlbumSecondaryNav',
  41. args: [album],
  42. slots: {mode: 'album'},
  43. });
  44. });