Skip to content

Commit

Permalink
test: 🗑️ remove duplicate test [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulRill00 committed Aug 7, 2024
1 parent a401aef commit e97b054
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions test/PrintOne.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2144,30 +2144,6 @@ describe("isValidWebhook", function () {
});
});

describe("isValidWebhook", function () {
const body =
'{"data":{"id":"ord_QXitaPr7MumnHo2BYXuW9","companyId":"2bd4c679-3d59-4a6f-a815-a60424746f8d","templateId":"tmpl_AyDg3PxvP5ydyGq3kSFfj","finish":"GLOSSY","format":"POSTCARD_A5","mergeVariables":{},"recipient":{"name":"Your Name","address":"Street 1","postalCode":"1234 AB","city":"Amsterdam","country":"NL"},"definitiveCountryId":"NL","region":"NETHERLANDS","deliverySpeed":"FAST","isBillable":true,"status":"order_created","friendlyStatus":"Processing","errors":[],"metadata":{},"sendDate":"2024-01-01T00:00:00.000Z","createdAt":"2024-01-01T00:00:00.000Z","updatedAt":"2024-01-01T00:00:00.000Z","anonymizedAt":null,"csvOrderId":null},"created_at":"2024-06-03T13:14:46.501Z","event":"order_status_update"}';
const headers = {
"x-printone-hmac-sha256": "blmkCA9eG2fajvgpHx/RBirRO8rA4wRGf6gr1/v+V0g=",
};

it("should return false if header does not match", () => {
expect(
client.isValidWebhook(body, headers, "invalid-header-secret"),
).toBeFalse();
});

it("should return if signature is valid", () => {
expect(
client.isValidWebhook(
body,
headers,
"0YFMgi5yzciEJV2HBL9wKWtNDnos8TaMOqtjSNErnDYWfign0JdW81vpmb6T62r4",
),
).toBeTrue();
});
});

describe("validateWebhook", function () {
beforeEach(async function () {
//mock isValidWebhook
Expand Down

0 comments on commit e97b054

Please sign in to comment.