Skip to content

Fix flaky Form 1-Z history test due to filesystem ordering and empty summaryInfoOffering - #59

Merged
sroussey merged 2 commits into
crowdfundfrom
copilot/sub-pr-58
Feb 28, 2026
Merged

Fix flaky Form 1-Z history test due to filesystem ordering and empty summaryInfoOffering#59
sroussey merged 2 commits into
crowdfundfrom
copilot/sub-pr-58

Conversation

Copilot AI commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

The test should store offering summaries as history was non-deterministically failing because readdirSync returns files in filesystem order (not alphabetical), and the first file encountered with summaryInfoOffering contained a self-closing XML tag <summaryInfoOffering/>, which xml2js parses as [""].

The old condition summaryInfoOffering.length > 0 matched this (length=1), but processOfferingSummaries correctly skips non-object entries — so nothing was saved and histories.length was always 0.

Fix

Changed the test guard condition to check for actual object entries:

// Before
form1Z.formData.summaryInfoOffering.length > 0

// After
form1Z.formData.summaryInfoOffering.some((item) => typeof item === "object" && item !== null)

This skips files where summaryInfoOffering contains only empty/self-closing XML entries and advances to a file with real summary data.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…InfoOffering

Co-authored-by: sroussey <127349+sroussey@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing test in crowdfund Fix flaky Form 1-Z history test due to filesystem ordering and empty summaryInfoOffering Feb 28, 2026
@sroussey
sroussey marked this pull request as ready for review February 28, 2026 18:46
@sroussey
sroussey merged commit 525721e into crowdfund Feb 28, 2026
1 of 2 checks passed
@sroussey
sroussey deleted the copilot/sub-pr-58 branch February 28, 2026 18:46
sroussey pushed a commit that referenced this pull request Feb 28, 2026
sroussey pushed a commit that referenced this pull request Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants