channel.ts 798 B

123456789101112131415161718192021222324252627282930313233
  1. import { ChannelMetadata } from '../src'
  2. import { assert } from 'chai'
  3. describe('Channel Metadata', () => {
  4. it('Message', () => {
  5. const channel = new ChannelMetadata()
  6. const title = 'title'
  7. const description = 'description'
  8. const isPublic = false
  9. const language = 'fr'
  10. channel.setTitle(title)
  11. channel.setDescription(description)
  12. channel.setIsPublic(isPublic)
  13. channel.setLanguage(language)
  14. channel.setAvatarPhoto(0)
  15. channel.setCoverPhoto(1)
  16. channel.setCategory(100)
  17. assert.deepEqual(channel.toObject(), {
  18. title,
  19. description,
  20. isPublic,
  21. language,
  22. avatarPhoto: 0,
  23. coverPhoto: 1,
  24. category: 100,
  25. })
  26. assert.deepEqual(ChannelMetadata.deserializeBinary(channel.serializeBinary()), channel)
  27. })
  28. })