Apply patch [skip ci]
This commit is contained in:
parent
50c4479e86
commit
a307723205
@ -131,7 +131,7 @@ 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 || "";
|
||||||
|
|
||||||
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,
|
||||||
@ -139,8 +139,8 @@ test("landlord can approve a lease", async ({ page }: { page: Page }) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const approvalPayload = await approvalResponse.json();
|
const requestApprovalPayload = await requestApprovalResponse.json();
|
||||||
const leaseId = approvalPayload?.lease?.id || "";
|
const leaseId = requestApprovalPayload?.lease?.id || "";
|
||||||
|
|
||||||
// Navigate to approvals page
|
// Navigate to approvals page
|
||||||
await page.goto("/landlord/approvals");
|
await page.goto("/landlord/approvals");
|
||||||
@ -180,7 +180,7 @@ 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 || "";
|
||||||
|
|
||||||
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,
|
||||||
@ -188,8 +188,8 @@ test("landlord can reject a lease with reason", async ({ page }: { page: Page })
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const approvalPayload = await approvalResponse.json();
|
const requestApprovalPayload = await requestApprovalResponse.json();
|
||||||
const leaseId = approvalPayload?.lease?.id || "";
|
const leaseId = requestApprovalPayload?.lease?.id || "";
|
||||||
|
|
||||||
// Navigate to approvals page
|
// Navigate to approvals page
|
||||||
await page.goto("/landlord/approvals");
|
await page.goto("/landlord/approvals");
|
||||||
@ -230,7 +230,7 @@ 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 || "";
|
||||||
|
|
||||||
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,
|
||||||
@ -238,8 +238,8 @@ test("tenant sees updated approval status on invite page", async ({ page }: { pa
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const approvalPayload = await approvalResponse.json();
|
const requestApprovalPayload = await requestApprovalResponse.json();
|
||||||
const leaseId = approvalPayload?.lease?.id || "";
|
const leaseId = requestApprovalPayload?.lease?.id || "";
|
||||||
|
|
||||||
// Approve lease as landlord
|
// Approve lease as landlord
|
||||||
await page.request.post("/api/lease/approve", {
|
await page.request.post("/api/lease/approve", {
|
||||||
@ -274,7 +274,7 @@ 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 || "";
|
||||||
|
|
||||||
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,
|
||||||
@ -282,8 +282,8 @@ test("tenant sees rejected status on invite page", async ({ page }: { page: Page
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const approvalPayload = await approvalResponse.json();
|
const requestApprovalPayload = await requestApprovalResponse.json();
|
||||||
const leaseId = approvalPayload?.lease?.id || "";
|
const leaseId = requestApprovalPayload?.lease?.id || "";
|
||||||
|
|
||||||
const rejectionReason = "Property not available";
|
const rejectionReason = "Property not available";
|
||||||
await page.request.post("/api/lease/reject", {
|
await page.request.post("/api/lease/reject", {
|
||||||
@ -386,7 +386,7 @@ 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 || "";
|
||||||
|
|
||||||
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,
|
||||||
@ -394,8 +394,8 @@ test("landlord cannot approve lease they don't own", async ({ page }: { page: Pa
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const approvalPayload = await approvalResponse.json();
|
const requestApprovalPayload = await requestApprovalResponse.json();
|
||||||
const leaseId = approvalPayload?.lease?.id || "";
|
const leaseId = requestApprovalPayload?.lease?.id || "";
|
||||||
|
|
||||||
// Try to approve as landlord (should fail)
|
// Try to approve as landlord (should fail)
|
||||||
await useE2EUser(page, "landlord");
|
await useE2EUser(page, "landlord");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user