Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ibalosh committed Oct 9, 2023
1 parent 9f64acd commit 87ca177
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/integration/DataRemoval.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import {expect} from "chai";
import "mocha";

import {DataRemovalStatus, DataRemovalStatusTypes} from "../../src/client/models";
import * as postmark from "../../src/index";

import * as dotenv from "dotenv";
dotenv.config();

describe("DataRemoval", () => {
const accountToken: any = process.env.ACCOUNT_API_TOKEN;
const client = new postmark.AccountClient(accountToken);
const fromAddress: any = process.env.SENDER_EMAIL_ADDRESS;

it("createDataRemoval", async () => {
const dataRemovalStatus:DataRemovalStatus = await client.createDataRemoval({
RequestedBy: fromAddress.toString(),
RequestedFor: '[email protected]',
NotifyWhenCompleted: false})

expect(dataRemovalStatus.Status).to.eq(DataRemovalStatusTypes.Pending);
expect(dataRemovalStatus.ID).to.be.gt(0);
});

it("getDataRemoval", async () => {
let dataRemovalStatus: DataRemovalStatus = await client.createDataRemoval({
RequestedBy: fromAddress.toString(),
RequestedFor: '[email protected]',
NotifyWhenCompleted: false})

const dataRemovalStatusId:number = dataRemovalStatus.ID;
dataRemovalStatus = await client.getDataRemoval(dataRemovalStatusId);
expect(dataRemovalStatus.ID).to.eq(dataRemovalStatusId)
});
});

0 comments on commit 87ca177

Please sign in to comment.