Apply patch [skip ci]
This commit is contained in:
parent
7140f361ec
commit
64b0cf923c
@ -23,13 +23,16 @@ test("tenant can request lease approval", async ({ page }: { page: Page }) => {
|
|||||||
expect(inviteId).toBeTruthy();
|
expect(inviteId).toBeTruthy();
|
||||||
|
|
||||||
// Request lease approval
|
// Request lease approval
|
||||||
const approvalResponse = await page.request.post("/api/lease/request-approval", {
|
const approvalResponse = await page.request.post(
|
||||||
|
"/api/lease/request-approval",
|
||||||
|
{
|
||||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||||
data: {
|
data: {
|
||||||
invite_id: inviteId,
|
invite_id: inviteId,
|
||||||
property_id: "e2e-prop-1",
|
property_id: "e2e-prop-1",
|
||||||
},
|
},
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
expect(approvalResponse.ok()).toBeTruthy();
|
expect(approvalResponse.ok()).toBeTruthy();
|
||||||
|
|
||||||
@ -131,13 +134,16 @@ test("landlord can approve a lease", async ({ page }: { page: Page }) => {
|
|||||||
const invitePayload = await inviteResponse.json();
|
const invitePayload = await inviteResponse.json();
|
||||||
const inviteId = invitePayload?.invite?.id || "";
|
const inviteId = invitePayload?.invite?.id || "";
|
||||||
|
|
||||||
const requestApprovalResponse = await page.request.post("/api/lease/request-approval", {
|
const requestApprovalResponse = await page.request.post(
|
||||||
|
"/api/lease/request-approval",
|
||||||
|
{
|
||||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||||
data: {
|
data: {
|
||||||
invite_id: inviteId,
|
invite_id: inviteId,
|
||||||
property_id: "e2e-prop-1",
|
property_id: "e2e-prop-1",
|
||||||
},
|
},
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const requestApprovalPayload = await requestApprovalResponse.json();
|
const requestApprovalPayload = await requestApprovalResponse.json();
|
||||||
const leaseId = requestApprovalPayload?.lease?.id || "";
|
const leaseId = requestApprovalPayload?.lease?.id || "";
|
||||||
@ -146,7 +152,8 @@ test("landlord can approve a lease", async ({ page }: { page: Page }) => {
|
|||||||
await page.goto("/landlord/approvals");
|
await page.goto("/landlord/approvals");
|
||||||
|
|
||||||
// Submit approval form
|
// Submit approval form
|
||||||
const approveForm = page.locator('form').filter({ hasText: "approve" }).first();
|
const approveForm = page.locator("form").filter({ hasText: "approve" })
|
||||||
|
.first();
|
||||||
|
|
||||||
const approveResponse = await page.request.post("/api/lease/approve", {
|
const approveResponse = await page.request.post("/api/lease/approve", {
|
||||||
headers: { "Content-Type": "application/json", ...e2eHeaders("landlord") },
|
headers: { "Content-Type": "application/json", ...e2eHeaders("landlord") },
|
||||||
@ -179,13 +186,16 @@ test("landlord can reject a lease with reason", async ({ page }: { page: Page })
|
|||||||
const invitePayload = await inviteResponse.json();
|
const invitePayload = await inviteResponse.json();
|
||||||
const inviteId = invitePayload?.invite?.id || "";
|
const inviteId = invitePayload?.invite?.id || "";
|
||||||
|
|
||||||
const requestApprovalResponse = await page.request.post("/api/lease/request-approval", {
|
const requestApprovalResponse = await page.request.post(
|
||||||
|
"/api/lease/request-approval",
|
||||||
|
{
|
||||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||||
data: {
|
data: {
|
||||||
invite_id: inviteId,
|
invite_id: inviteId,
|
||||||
property_id: "e2e-prop-1",
|
property_id: "e2e-prop-1",
|
||||||
},
|
},
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const requestApprovalPayload = await requestApprovalResponse.json();
|
const requestApprovalPayload = await requestApprovalResponse.json();
|
||||||
const leaseId = requestApprovalPayload?.lease?.id || "";
|
const leaseId = requestApprovalPayload?.lease?.id || "";
|
||||||
@ -194,7 +204,7 @@ test("landlord can reject a lease with reason", async ({ page }: { page: Page })
|
|||||||
await page.goto("/landlord/approvals");
|
await page.goto("/landlord/approvals");
|
||||||
|
|
||||||
// Submit rejection form with reason
|
// Submit rejection form with reason
|
||||||
const rejectForm = page.locator('form').filter({ hasText: "reject" }).first();
|
const rejectForm = page.locator("form").filter({ hasText: "reject" }).first();
|
||||||
|
|
||||||
const rejectionReason = "Insufficient income verification";
|
const rejectionReason = "Insufficient income verification";
|
||||||
const rejectResponse = await page.request.post("/api/lease/reject", {
|
const rejectResponse = await page.request.post("/api/lease/reject", {
|
||||||
@ -228,13 +238,16 @@ test("tenant sees updated approval status on invite page", async ({ page }: { pa
|
|||||||
const invitePayload = await inviteResponse.json();
|
const invitePayload = await inviteResponse.json();
|
||||||
const inviteId = invitePayload?.invite?.id || "";
|
const inviteId = invitePayload?.invite?.id || "";
|
||||||
|
|
||||||
const requestApprovalResponse = await page.request.post("/api/lease/request-approval", {
|
const requestApprovalResponse = await page.request.post(
|
||||||
|
"/api/lease/request-approval",
|
||||||
|
{
|
||||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||||
data: {
|
data: {
|
||||||
invite_id: inviteId,
|
invite_id: inviteId,
|
||||||
property_id: "e2e-prop-1",
|
property_id: "e2e-prop-1",
|
||||||
},
|
},
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const requestApprovalPayload = await requestApprovalResponse.json();
|
const requestApprovalPayload = await requestApprovalResponse.json();
|
||||||
const leaseId = requestApprovalPayload?.lease?.id || "";
|
const leaseId = requestApprovalPayload?.lease?.id || "";
|
||||||
@ -272,13 +285,16 @@ test("tenant sees rejected status on invite page", async ({ page }: { page: Page
|
|||||||
const invitePayload = await inviteResponse.json();
|
const invitePayload = await inviteResponse.json();
|
||||||
const inviteId = invitePayload?.invite?.id || "";
|
const inviteId = invitePayload?.invite?.id || "";
|
||||||
|
|
||||||
const requestApprovalResponse = await page.request.post("/api/lease/request-approval", {
|
const requestApprovalResponse = await page.request.post(
|
||||||
|
"/api/lease/request-approval",
|
||||||
|
{
|
||||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||||
data: {
|
data: {
|
||||||
invite_id: inviteId,
|
invite_id: inviteId,
|
||||||
property_id: "e2e-prop-1",
|
property_id: "e2e-prop-1",
|
||||||
},
|
},
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const requestApprovalPayload = await requestApprovalResponse.json();
|
const requestApprovalPayload = await requestApprovalResponse.json();
|
||||||
const leaseId = requestApprovalPayload?.lease?.id || "";
|
const leaseId = requestApprovalPayload?.lease?.id || "";
|
||||||
@ -384,13 +400,16 @@ test("landlord cannot approve lease they don't own", async ({ page }: { page: Pa
|
|||||||
const invitePayload = await inviteResponse.json();
|
const invitePayload = await inviteResponse.json();
|
||||||
const inviteId = invitePayload?.invite?.id || "";
|
const inviteId = invitePayload?.invite?.id || "";
|
||||||
|
|
||||||
const requestApprovalResponse = await page.request.post("/api/lease/request-approval", {
|
const requestApprovalResponse = await page.request.post(
|
||||||
|
"/api/lease/request-approval",
|
||||||
|
{
|
||||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||||
data: {
|
data: {
|
||||||
invite_id: inviteId,
|
invite_id: inviteId,
|
||||||
property_id: "e2e-prop-1",
|
property_id: "e2e-prop-1",
|
||||||
},
|
},
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const requestApprovalPayload = await requestApprovalResponse.json();
|
const requestApprovalPayload = await requestApprovalResponse.json();
|
||||||
const leaseId = requestApprovalPayload?.lease?.id || "";
|
const leaseId = requestApprovalPayload?.lease?.id || "";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user