Skip to content

Commit

Permalink
Add tests for creating leads, getting auth token, and creating new se…
Browse files Browse the repository at this point in the history
…rvice group
  • Loading branch information
dphuang2 committed Jan 22, 2024
1 parent 485b819 commit 4789f2e
Showing 1 changed file with 42 additions and 3 deletions.
45 changes: 42 additions & 3 deletions typescript/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,47 @@
import { Bellhop } from "./index";

describe("bellhop-partners-typescript", () => {
it("initialize client", async () => {
const bellhop = new Bellhop({
});
it("initialize client", async () => {
const bellhop = new Bellhop({});
});
it("Create Lead", async () => {
const bellhop = new Bellhop({
accessToken: "ACCESS_TOKEN",
basePath: "http://127.0.0.1:4010",
});
const lead = await bellhop.leads.create({
first_name: "John",
last_name: "Doe",
lead_type: "Zillow",
lead_record_type: "Potential Customer",
});
console.log(lead.data);
});
it("Get Auth token", async () => {
const bellhop = new Bellhop({
accessToken: "ACCESS_TOKEN",
basePath: "http://127.0.0.1:4010",
});
const token = await bellhop.authorization.getAuthToken({
client_id: "CLIENT_ID",
client_secret: "CLIENT_SECRET",
audience: "Dev",
});
console.log(token.data);
});
it("Create New Service Group", async () => {
const bellhop = new Bellhop({
accessToken: "ACCESS_TOKEN",
basePath: "http://127.0.0.1:4010",
});

const serviceGroup = await bellhop.quoteServiceGroups.create({
quoteId: "QUOTE_ID",
service_codes: ["LOADING"],
locations: ["LOCATION_ID"],
start_datetime: new Date().toISOString(),
});

console.log(serviceGroup.data);
});
});

0 comments on commit 4789f2e

Please sign in to comment.