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();
|
||||
|
||||
// Request lease approval
|
||||
const approvalResponse = await page.request.post("/api/lease/request-approval", {
|
||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||
data: {
|
||||
invite_id: inviteId,
|
||||
property_id: "e2e-prop-1",
|
||||
const approvalResponse = await page.request.post(
|
||||
"/api/lease/request-approval",
|
||||
{
|
||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||
data: {
|
||||
invite_id: inviteId,
|
||||
property_id: "e2e-prop-1",
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
|
||||
expect(approvalResponse.ok()).toBeTruthy();
|
||||
|
||||
@ -131,13 +134,16 @@ test("landlord can approve a lease", async ({ page }: { page: Page }) => {
|
||||
const invitePayload = await inviteResponse.json();
|
||||
const inviteId = invitePayload?.invite?.id || "";
|
||||
|
||||
const requestApprovalResponse = await page.request.post("/api/lease/request-approval", {
|
||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||
data: {
|
||||
invite_id: inviteId,
|
||||
property_id: "e2e-prop-1",
|
||||
const requestApprovalResponse = await page.request.post(
|
||||
"/api/lease/request-approval",
|
||||
{
|
||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||
data: {
|
||||
invite_id: inviteId,
|
||||
property_id: "e2e-prop-1",
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
|
||||
const requestApprovalPayload = await requestApprovalResponse.json();
|
||||
const leaseId = requestApprovalPayload?.lease?.id || "";
|
||||
@ -146,7 +152,8 @@ test("landlord can approve a lease", async ({ page }: { page: Page }) => {
|
||||
await page.goto("/landlord/approvals");
|
||||
|
||||
// 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", {
|
||||
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 inviteId = invitePayload?.invite?.id || "";
|
||||
|
||||
const requestApprovalResponse = await page.request.post("/api/lease/request-approval", {
|
||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||
data: {
|
||||
invite_id: inviteId,
|
||||
property_id: "e2e-prop-1",
|
||||
const requestApprovalResponse = await page.request.post(
|
||||
"/api/lease/request-approval",
|
||||
{
|
||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||
data: {
|
||||
invite_id: inviteId,
|
||||
property_id: "e2e-prop-1",
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
|
||||
const requestApprovalPayload = await requestApprovalResponse.json();
|
||||
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");
|
||||
|
||||
// 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 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 inviteId = invitePayload?.invite?.id || "";
|
||||
|
||||
const requestApprovalResponse = await page.request.post("/api/lease/request-approval", {
|
||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||
data: {
|
||||
invite_id: inviteId,
|
||||
property_id: "e2e-prop-1",
|
||||
const requestApprovalResponse = await page.request.post(
|
||||
"/api/lease/request-approval",
|
||||
{
|
||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||
data: {
|
||||
invite_id: inviteId,
|
||||
property_id: "e2e-prop-1",
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
|
||||
const requestApprovalPayload = await requestApprovalResponse.json();
|
||||
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 inviteId = invitePayload?.invite?.id || "";
|
||||
|
||||
const requestApprovalResponse = await page.request.post("/api/lease/request-approval", {
|
||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||
data: {
|
||||
invite_id: inviteId,
|
||||
property_id: "e2e-prop-1",
|
||||
const requestApprovalResponse = await page.request.post(
|
||||
"/api/lease/request-approval",
|
||||
{
|
||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||
data: {
|
||||
invite_id: inviteId,
|
||||
property_id: "e2e-prop-1",
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
|
||||
const requestApprovalPayload = await requestApprovalResponse.json();
|
||||
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 inviteId = invitePayload?.invite?.id || "";
|
||||
|
||||
const requestApprovalResponse = await page.request.post("/api/lease/request-approval", {
|
||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||
data: {
|
||||
invite_id: inviteId,
|
||||
property_id: "e2e-prop-1",
|
||||
const requestApprovalResponse = await page.request.post(
|
||||
"/api/lease/request-approval",
|
||||
{
|
||||
headers: { "Content-Type": "application/json", ...e2eHeaders("tenant") },
|
||||
data: {
|
||||
invite_id: inviteId,
|
||||
property_id: "e2e-prop-1",
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
|
||||
const requestApprovalPayload = await requestApprovalResponse.json();
|
||||
const leaseId = requestApprovalPayload?.lease?.id || "";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user