This commit is contained in:
2026-03-02 12:06:52 -08:00
parent db593886a3
commit d248753984
2 changed files with 670 additions and 71 deletions

View File

@@ -52,7 +52,7 @@ namespace raven_integration
// -------------------------------------------------------------------
var updatedName = Util.Uniquify("Updated Contract");
var putPayload = $$"""
{"id":{{Id}},"concurrency":{{concurrency}},"name":"{{updatedName}}","active":true,"notes":"Updated notes","wiki":null,"customFields":"{}","tags":[],"responseTime":"02:00:00","contractServiceRatesOnly":true,"contractTravelRatesOnly":false,"partsOverridePct":15.0,"partsOverrideType":2,"serviceRatesOverridePct":0.0,"serviceRatesOverrideType":1,"travelRatesOverridePct":5.0,"travelRatesOverrideType":1,"alertNotes":"Updated alert"}
{"id":{{Id}},"concurrency":{{concurrency}},"name":"{{updatedName}}","active":true,"notes":"Updated notes","wiki":null,"customFields":"{}","tags":[],"responseTime":"02:00:00","contractServiceRatesOnly":false,"contractTravelRatesOnly":false,"partsOverridePct":15.0,"partsOverrideType":2,"serviceRatesOverridePct":0.0,"serviceRatesOverrideType":1,"travelRatesOverridePct":5.0,"travelRatesOverrideType":1,"alertNotes":"Updated alert"}
""";
a = await Util.PutAsync("contract", token, putPayload);
Util.ValidateHTTPStatusCode(a, 200);
@@ -66,7 +66,7 @@ namespace raven_integration
a = await Util.GetAsync($"contract/{Id}", token);
Util.ValidateDataReturnResponseOk(a);
a.ObjectResponse["data"]["name"].Value<string>().Should().Be(updatedName);
a.ObjectResponse["data"]["contractServiceRatesOnly"].Value<bool>().Should().BeTrue();
a.ObjectResponse["data"]["contractServiceRatesOnly"].Value<bool>().Should().BeFalse();
// -------------------------------------------------------------------
// CONCURRENCY VIOLATION: PUT with stale concurrency should return 409
@@ -81,6 +81,12 @@ namespace raven_integration
Util.ValidateHTTPStatusCode(a, 204);
// Confirm deleted
//bugbug case 4652 TO be fixed for this test to pass
//bug at server causing 500 to be returned instead of 404
//do not want to fix yet until ready for refactor in general
//deployed UI unaffected as it wouldn't attempt this normally
//this problem likely exhibits in any other object that has a 'populatedisplayfields' call at the server
//in their get routine that doesn't guard against null record
a = await Util.GetAsync($"contract/{Id}", token);
Util.ValidateResponseNotFound(a);
}