content-test.sh 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. yarn workspace api-scripts initialize-content-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
  51. # Remove videos/channels/assets
  52. yarn joystream-cli content:removeChannelAssets -c 1 -o 0
  53. yarn joystream-cli content:deleteVideo -v 1 -f
  54. yarn joystream-cli content:deleteVideo -v 2 -f
  55. yarn joystream-cli content:deleteVideo -v 3 -f
  56. yarn joystream-cli content:deleteChannel -c 1 -f
  57. yarn joystream-cli content:deleteChannel -c 2 -f
  58. yarn joystream-cli content:deleteChannel -c 3 -f