File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ //@ts -nocheck
2+ import { MultiChannelApi } from '../../../api' ;
3+ import { Configuration } from '../../../configuration' ;
4+ import {
5+ MultiChannelChannelListObject ,
6+ MultiChannelMessageChannelEnum ,
7+ PriorityEnum ,
8+ RbmMessageContentText
9+ } from '../../../models' ;
10+
11+ describe ( 'MultiChannelApi' , ( ) => {
12+ const config = new Configuration ( {
13+ username : BW_USERNAME ,
14+ password : BW_PASSWORD ,
15+ basePath : 'http://127.0.0.1:4010'
16+ } ) ;
17+ const multiChannelApi = new MultiChannelApi ( config ) ;
18+
19+ const expirationTime = Date . now ( ) + 1000 * 60 * 60 * 24 + 60 ;
20+ const expiration = new Date ( expirationTime ) . toISOString ( ) ;
21+
22+ describe ( 'createMultiChannelMessage' , ( ) => {
23+ test . skip ( 'should create a multi-channel message' , async ( ) => { // skip because prism can't handle a oneOf with differing required fields
24+ const channelListObject : MultiChannelChannelListObject = {
25+ from : BW_NUMBER ,
26+ applicationId : BW_MESSAGING_APPLICATION_ID ,
27+ channel : MultiChannelMessageChannelEnum . Rbm ,
28+ content : {
29+ text : "Hello World!"
30+ }
31+ } ;
32+
33+ const multiChannelMessageRequest : MultiChannelMessageRequest = {
34+ to : USER_NUMBER ,
35+ tag : "tag" ,
36+ priority : PriorityEnum . HIGH ,
37+ expiration,
38+ } ;
39+
40+ const { status, data } = await multiChannelApi . createMultiChannelMessage ( BW_ACCOUNT_ID , multiChannelMessageRequest ) ;
41+
42+ expect ( status ) . toEqual ( 202 ) ;
43+ } ) ;
44+ } ) ;
45+ } ) ;
You can’t perform that action at this time.
0 commit comments