-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { expect } from 'chai'; | ||
import { before, describe, it } from 'mocha'; | ||
|
||
import { getCredentials } from '../../../data/api-data'; | ||
import { | ||
createVisitor, | ||
createLivechatRoom, | ||
createAgent, | ||
makeAgentAvailable, | ||
sendAgentMessage, | ||
getLivechatRoomInfo, | ||
} from '../../../data/livechat/rooms'; | ||
import { IS_EE } from '../../../e2e/config/constants'; | ||
|
||
(IS_EE ? describe : describe.skip)('MAC', () => { | ||
before((done) => getCredentials(done)); | ||
|
||
before(async () => { | ||
await createAgent(); | ||
await makeAgentAvailable(); | ||
}); | ||
|
||
it('Should create an innactive room by default', async () => { | ||
const visitor = await createVisitor(); | ||
const room = await createLivechatRoom(visitor.token); | ||
|
||
expect(room).to.be.an('object'); | ||
expect(room.v.activity).to.be.undefined; | ||
}); | ||
|
||
it('should mark room as active when agent sends a message', async () => { | ||
const visitor = await createVisitor(); | ||
const room = await createLivechatRoom(visitor.token); | ||
|
||
await sendAgentMessage(room._id); | ||
|
||
const updatedRoom = await getLivechatRoomInfo(room._id); | ||
|
||
expect(updatedRoom).to.have.nested.property('v.activity').and.to.be.an('array'); | ||
}); | ||
}); |