content-test.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/usr/bin/env bash
  2. set -e
  3. SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
  4. cd $SCRIPT_PATH
  5. echo "{}" > ~/tmp/empty.json
  6. export AUTO_CONFIRM=true
  7. # Init content lead
  8. GROUP=contentDirectoryWorkingGroup yarn workspace api-scripts initialize-lead
  9. # Test create/update/remove category
  10. yarn joystream-cli content:createVideoCategory -i ./examples/content/CreateCategory.json
  11. yarn joystream-cli content:createVideoCategory -i ./examples/content/CreateCategory.json
  12. yarn joystream-cli content:createVideoCategory -i ./examples/content/CreateCategory.json
  13. yarn joystream-cli content:createChannelCategory -i ./examples/content/CreateCategory.json
  14. yarn joystream-cli content:createChannelCategory -i ./examples/content/CreateCategory.json
  15. yarn joystream-cli content:createChannelCategory -i ./examples/content/CreateCategory.json
  16. yarn joystream-cli content:updateVideoCategory -i ./examples/content/UpdateCategory.json 2
  17. yarn joystream-cli content:updateChannelCategory -i ./examples/content/UpdateCategory.json 2
  18. yarn joystream-cli content:deleteChannelCategory 3
  19. yarn joystream-cli content:deleteVideoCategory 3
  20. # Group 1 - a valid group
  21. yarn joystream-cli content:createCuratorGroup
  22. yarn joystream-cli content:setCuratorGroupStatus 1 1
  23. yarn joystream-cli content:addCuratorToGroup 1 0
  24. # Group 2 - test removeCuratorFromGroup
  25. yarn joystream-cli content:createCuratorGroup
  26. yarn joystream-cli content:addCuratorToGroup 2 0
  27. yarn joystream-cli content:removeCuratorFromGroup 2 0
  28. # Create/update channel
  29. yarn joystream-cli content:createChannel -i ./examples/content/CreateChannel.json --context Member || true
  30. yarn joystream-cli content:createChannel -i ./examples/content/CreateChannel.json --context Curator || true
  31. yarn joystream-cli content:createChannel -i ~/tmp/empty.json --context Member || true
  32. yarn joystream-cli content:updateChannel -i ./examples/content/UpdateChannel.json 1 || true
  33. # Create/update video
  34. yarn joystream-cli content:createVideo -i ./examples/content/CreateVideo.json -c 1 || true
  35. yarn joystream-cli content:createVideo -i ./examples/content/CreateVideo.json -c 2 || true
  36. yarn joystream-cli content:createVideo -i ~/tmp/empty.json -c 2 || true
  37. yarn joystream-cli content:updateVideo -i ./examples/content/UpdateVideo.json 1 || true
  38. # Set featured videos
  39. yarn joystream-cli content:setFeaturedVideos 1,2
  40. yarn joystream-cli content:setFeaturedVideos 2,3
  41. # Update channel censorship status
  42. yarn joystream-cli content:updateChannelCensorshipStatus 1 1 --rationale "Test"
  43. yarn joystream-cli content:updateVideoCensorshipStatus 1 1 --rationale "Test"
  44. # Display-only commands
  45. yarn joystream-cli content:videos
  46. yarn joystream-cli content:video 1
  47. yarn joystream-cli content:channels
  48. yarn joystream-cli content:channel 1
  49. yarn joystream-cli content:curatorGroups
  50. yarn joystream-cli content:curatorGroup 1