Skip to content

Commit d515393

Browse files
committed
Added test cases and corrected readme
1 parent 1352df7 commit d515393

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Oracle Field Service Proxy
22

3-
A Javascript proxy to access Oracle Field Service cloud via REST API. For more information about the REST API please visit [the oficial documentation](https://www.oracle.com/pls/topic/lookup?ctx=en/cloud/saas/field-service&ID=field-service)
3+
A Javascript proxy to access Oracle Field Service cloud via REST API. For more information about the REST API please visit [the official documentation](https://www.oracle.com/pls/topic/lookup?ctx=en/cloud/saas/field-service&ID=field-service)
44

55
## Prerequisites
66

@@ -26,8 +26,6 @@ In order to use this library you need to have access to an Oracle Field Service
2626

2727
`getActivities()`: Get existing activities
2828

29-
`updateActivity(activityId, activityData)`: Update activity details
30-
3129
`createActivity(activityData)`: Create activity
3230

3331
`deleteActivity(activityId)`: Delete activity
@@ -80,7 +78,11 @@ In order to use this library you need to have access to an Oracle Field Service
8078

8179
`importPlugins(file?, data?)`: Import plugin by path or via an XML string
8280

83-
### Metadata: Property Management
81+
### Metadata:
82+
83+
`getTimeslots()` : Get a list of configured timeslots
84+
85+
_Property Management_
8486

8587
`getProperties()`: Get existing properties
8688

test/general/meta.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ var testConfig: any;
1818
interface MetaTestConfiguration {
1919
numberOfProperties: number;
2020
numberOfResourceProperties: number;
21+
numberOfTimeslots: number;
2122
}
2223
const TEST_CONFIG: Map<string, MetaTestConfiguration> = new Map<string, any>();
2324
TEST_CONFIG.set("23.11", {
2425
numberOfProperties: 464,
2526
numberOfResourceProperties: 34,
27+
numberOfTimeslots: 9,
2628
});
2729

2830
// Setup info
@@ -286,3 +288,17 @@ test("Update custom property", async () => {
286288
throw error;
287289
}
288290
});
291+
292+
test("Get a list of configured timeslots", async () => {
293+
var result = await myProxy.getTimeslots();
294+
try {
295+
expect(result.status).toBe(200);
296+
expect(result.status).toBe(200);
297+
expect(result.data.items.length).toBe(testConfig.numberOfTimeslots);
298+
expect(result.data.offset).toBe(0);
299+
expect(result.data.limit).toBe(100);
300+
} catch (error) {
301+
console.error(result);
302+
throw error;
303+
}
304+
});

0 commit comments

Comments
 (0)