channel.ts 646 B

123456789101112131415161718192021222324252627
  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. assert.deepEqual(channel.toObject(), {
  15. title,
  16. description,
  17. isPublic,
  18. language,
  19. })
  20. assert.deepEqual(ChannelMetadata.deserializeBinary(channel.serializeBinary()), channel)
  21. })
  22. })