test(vendors): isolate mutable reactivation state

This commit is contained in:
Alexandre Brandizzi 2026-07-28 17:22:42 -03:00
parent 4fe9319d7a
commit b1cf3a0678

View file

@ -186,7 +186,7 @@ async function mockVendorApi(
if (route.request().method() === "PUT") {
state.updatedBody = route.request().postDataJSON();
const vendor = vendorRecords.find((item) => String(item.Id) === id);
if (vendor && typeof state.updatedBody?.isActive === "boolean") {
if (options.legacyGateway && vendor && typeof state.updatedBody?.isActive === "boolean") {
vendor.IsActive = state.updatedBody.isActive;
}
await fulfillJson(route, {
@ -205,7 +205,7 @@ async function mockVendorApi(
}
state.deletedId = id;
const vendor = vendorRecords.find((item) => String(item.Id) === id);
if (vendor) vendor.IsActive = false;
if (options.legacyGateway && vendor) vendor.IsActive = false;
await fulfillJson(route, { status: "200" });
return;
}