@@ -101,4 +101,52 @@ describe('IPortalUser', () => {
101
101
var iPortalUser = new IPortalUser ( iportalUrl ) ;
102
102
expect ( iPortalUser . addData ( addDataParam , formData ) instanceof Promise ) . toBeTruthy ( ) ;
103
103
} ) ;
104
+
105
+ it ( 'publishOrUnpublish' , ( ) => {
106
+ var options = {
107
+ dataId :null ,
108
+ serviceType :'RESTDATA' ,
109
+ dataServiceId : null
110
+ }
111
+ var forPublish = true ;
112
+ var iportalUrl = 'https://iptl.supermap.io/iportal' ;
113
+ var iPortalUser = new IPortalUser ( iportalUrl ) ;
114
+ iPortalUser . publishOrUnpublish ( options , forPublish ) . then ( res => {
115
+ expect ( res ) . toBe ( "option.dataID and option.serviceType are Required!" ) ;
116
+ } )
117
+ } ) ;
118
+
119
+ it ( 'getDataPublishedStatus' , ( ) => {
120
+ var dataId = 1 ;
121
+ var dataServiceId = "map-city" ;
122
+ var iportalUrl = 'https://iptl.supermap.io/iportal' ;
123
+ var iPortalUser = new IPortalUser ( iportalUrl ) ;
124
+ expect ( iPortalUser . getDataPublishedStatus ( dataId , dataServiceId ) instanceof Promise ) . toBeTruthy ( ) ;
125
+ } ) ;
126
+
127
+ it ( 'unPublishDataService' , ( ) => {
128
+ var options = {
129
+ dataId :1 ,
130
+ serviceType :null ,
131
+ dataServiceId : null
132
+ }
133
+ var iportalUrl = 'https://iptl.supermap.io/iportal' ;
134
+ var iPortalUser = new IPortalUser ( iportalUrl ) ;
135
+ iPortalUser . unPublishDataService ( options ) . then ( res => {
136
+ expect ( res ) . toBe ( "option.dataID and option.serviceType are Required!" ) ;
137
+ } )
138
+ } ) ;
139
+
140
+ it ( 'publishDataService' , ( ) => {
141
+ var options = {
142
+ dataId :1 ,
143
+ serviceType :null ,
144
+ dataServiceId : null
145
+ }
146
+ var iportalUrl = 'https://iptl.supermap.io/iportal' ;
147
+ var iPortalUser = new IPortalUser ( iportalUrl ) ;
148
+ iPortalUser . publishDataService ( options ) . then ( res => {
149
+ expect ( res ) . toBe ( "option.dataID and option.serviceType are Required!" ) ;
150
+ } )
151
+ } ) ;
104
152
} ) ;
0 commit comments