1 | import * as postmark from "../../src/index";
|
2 |
|
3 | import { expect } from "chai";
|
4 | import "mocha";
|
5 |
|
6 | import * as nconf from "nconf";
|
7 | const testingKeys = nconf.env().file({ file: __dirname + "/../../testing_keys.json" });
|
8 |
|
9 | describe("Client - Click Statistics", () => {
|
10 | const serverToken: string = testingKeys.get("SERVER_TOKEN");
|
11 | const client = new postmark.ServerClient(serverToken);
|
12 |
|
13 | it("getClickCounts", async () => {
|
14 | const stats = await client.getClickCounts();
|
15 | expect(stats.Clicks).to.be.gte(0);
|
16 | });
|
17 |
|
18 | it("getClickBrowserUsage", async () => {
|
19 | const stats = await client.getClickBrowserUsage();
|
20 | expect(stats.Days.length).to.be.gte(0);
|
21 | });
|
22 |
|
23 | it("getEmailOpenPlatformUsage", async () => {
|
24 | const stats = await client.getEmailOpenPlatformUsage();
|
25 | expect(stats.Days.length).to.be.gte(0);
|
26 | });
|
27 |
|
28 | it("getClickLocation", async () => {
|
29 | const stats = await client.getClickLocation();
|
30 | expect(stats.Days.length).to.be.gte(0);
|
31 | });
|
32 | });
|