-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for creating leads, getting auth token, and creating new se…
…rvice group
- Loading branch information
Showing
1 changed file
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
}); |