Skip to content

Commit 52b7d93

Browse files
author
杜美瑶
committed
iportal数据发布/取消发布API UT测试
1 parent ea097d4 commit 52b7d93

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

test/common/iPortal/iPortalUserSpec.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,52 @@ describe('IPortalUser', () => {
101101
var iPortalUser = new IPortalUser(iportalUrl);
102102
expect(iPortalUser.addData(addDataParam,formData) instanceof Promise).toBeTruthy();
103103
});
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+
});
104152
});

0 commit comments

Comments
 (0)