forked from microsoftgraph/msgraph-sdk-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsights.ts
More file actions
62 lines (55 loc) · 1.49 KB
/
Copy pathinsights.ts
File metadata and controls
62 lines (55 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* -------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
* See License in the project root for license information.
* -------------------------------------------------------------------------------------------
*/
import { assert } from "chai";
import { Person } from "microsoft-graph";
import { getClient } from "../test-helper";
const client = getClient();
describe("Social and Insights", function() {
this.timeout(10 * 1000);
it("Fetch a list of people", async () => {
try {
const res = await client.api("/me/people").get();
const person = res.value[0] as Person;
assert.isDefined(person.displayName);
assert.isDefined(person.surname);
assert.isDefined(person.id);
assert.isUndefined(person["random fake property that should be null"]);
} catch (error) {
throw error;
}
});
it("Searches the people list", async () => {
try {
await client
.api("/me/people")
.query("$search=j")
.get();
} catch (error) {
throw error;
}
});
it("Searches the people list with a topic", async () => {
try {
await client
.api("/me/people")
.query(`$search="topic: planning"`)
.get();
} catch (error) {
throw error;
}
});
it("Finds items trending around me", async () => {
try {
await client
.api("/me/insights/trending")
.version("beta")
.get();
} catch (error) {
throw error;
}
});
});