What changed, and why it matters
This commit fixes a flaky automated test for the crowdfunding feature. The test previously cleared a date field by directly manipulating the webpage's internal value, which was unreliable. The change makes the test click a visible 'Clear' button instead, and adds an ID to that button so the test can find it. There is no security issue here.
No security action needed. This is a routine test reliability fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies a Playwright UI test (CanCreateCrowdfundingApp) and the corresponding Razor view. The test no longer uses EvaluateAsync to blank out the EndDate input’s value property; it now clicks a dedicated clear button. The view adds id=’clear_end’ to that button so the test selector works. This is purely a test-stability improvement with no production behavior change.
Changed components
BTCPayServer.Tests/PlaywrightTests.csBTCPayServer/Plugins/Crowdfund/Views/UpdateCrowdfund.cshtmlInspect captured patch +3 / −2
diff --git a/BTCPayServer.Tests/PlaywrightTests.cs b/BTCPayServer.Tests/PlaywrightTests.cs
index a499891..7f6e5ba 100644
--- a/BTCPayServer.Tests/PlaywrightTests.cs
+++ b/BTCPayServer.Tests/PlaywrightTests.cs
@@ -3115,9 +3115,10 @@ namespace BTCPayServer.Tests
Assert.DoesNotContain("App updated", pageContent);
// unset end date
- await s.Page.EvaluateAsync("document.getElementById('EndDate').value = ''");
+ await s.Page.ClickAsync("#clear_end");
await s.ClickPagePrimary();
await s.FindAlertMessage(partialText: "App updated");
+
var editUrl = s.Page.Url;
// Check public page
diff --git a/BTCPayServer/Plugins/Crowdfund/Views/UpdateCrowdfund.cshtml b/BTCPayServer/Plugins/Crowdfund/Views/UpdateCrowdfund.cshtml
index 97e7747..90cd9d7 100644
--- a/BTCPayServer/Plugins/Crowdfund/Views/UpdateCrowdfund.cshtml
+++ b/BTCPayServer/Plugins/Crowdfund/Views/UpdateCrowdfund.cshtml
@@ -158,7 +158,7 @@
value="@(Model.EndDate?.ToString("u", CultureInfo.InvariantCulture))"
class="form-control flatdtpicker"
placeholder="@StringLocalizer["No end date has been set"]" />
- <button class="btn btn-secondary input-group-clear px-3" type="button" title="Clear">
+ <button class="btn btn-secondary input-group-clear px-3" type="button" title="Clear" id="clear_end">
<vc:icon symbol="close"/>
</button>
</div>
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.