This commit is contained in:
2026-05-13 19:58:16 +03:00
commit f5adeb292b
78 changed files with 12024 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
const expect = require('chai').expect
const directChannel = require('../directChannel')
const basic = {
members: [
'username1',
'username2'
]
}
describe('team factory', function() {
it('should produce a valid object', function() {
var c = directChannel(basic)
expect(c).to.be.an('object')
expect(c).to.deep.equal({
type: 'direct_channel',
direct_channel: basic
})
})
it('should prevent less than 2 members', function() {
try {
directChannel(Object.assign({}, basic, {
members:[
'username1'
]
}))
}
catch (e) {
expect(e).to.be.an('error')
expect(e.details[0].message).to.equal('"members" must contain at least 2 items')
}
})
})