UNPKG

1.02 kBPlain TextView Raw
1import * as postmark from "../../src/index";
2
3import { expect } from "chai";
4import "mocha";
5
6import * as nconf from "nconf";
7const testingKeys = nconf.env().file({ file: __dirname + "/../../testing_keys.json" });
8
9describe("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});