content-test.sh 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. yarn workspace api-scripts initialize-content-lead
  8. # Test create/update/remove category
  9. yarn joystream-cli content:createVideoCategory -i ./examples/content/CreateCategory.json
  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:createChannelCategory -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:updateVideoCategory -i ./examples/content/UpdateCategory.json 2
  16. yarn joystream-cli content:updateChannelCategory -i ./examples/content/UpdateCategory.json 2
  17. yarn joystream-cli content:deleteChannelCategory 3
  18. yarn joystream-cli content:deleteVideoCategory 3
  19. # Group 1 - a valid group
  20. yarn joystream-cli content:createCuratorGroup
  21. yarn joystream-cli content:setCuratorGroupStatus 1 1
  22. yarn joystream-cli content:addCuratorToGroup 1 0
  23. # Group 2 - test removeCuratorFromGroup
  24. yarn joystream-cli content:createCuratorGroup
  25. yarn joystream-cli content:addCuratorToGroup 2 0
  26. yarn joystream-cli content:removeCuratorFromGroup 2 0
  27. # Create/update channel
  28. yarn joystream-cli content:createChannel -i ./examples/content/CreateChannel.json --context Member || true
  29. yarn joystream-cli content:createChannel -i ./examples/content/CreateChannel.json --context Curator || true
  30. yarn joystream-cli content:createChannel -i ~/tmp/empty.json --context Member || true
  31. yarn joystream-cli content:updateChannel -i ./examples/content/UpdateChannel.json 1 || true
  32. # Create/update video
  33. yarn joystream-cli content:createVideo -i ./examples/content/CreateVideo.json -c 1 || true
  34. yarn joystream-cli content:createVideo -i ./examples/content/CreateVideo.json -c 2 || true
  35. yarn joystream-cli content:createVideo -i ~/tmp/empty.json -c 2 || true
  36. yarn joystream-cli content:updateVideo -i ./examples/content/UpdateVideo.json 1 || true
  37. # Set featured videos
  38. yarn joystream-cli content:setFeaturedVideos 1,2
  39. yarn joystream-cli content:setFeaturedVideos 2,3
  40. # Update channel censorship status
  41. yarn joystream-cli content:updateChannelCensorshipStatus 1 1 --rationale "Test"
  42. yarn joystream-cli content:updateVideoCensorshipStatus 1 1 --rationale "Test"
  43. # Display-only commands
  44. yarn joystream-cli content:videos
  45. yarn joystream-cli content:video 1
  46. yarn joystream-cli content:channels
  47. yarn joystream-cli content:channel 1
  48. yarn joystream-cli content:curatorGroups
  49. yarn joystream-cli content:curatorGroup 1