[repo-assist] Add unit tests for WidgetDiff.WidgetChanges diffing - #1316
Draft
github-actions[bot] wants to merge 1 commit into
Draft
[repo-assist] Add unit tests for WidgetDiff.WidgetChanges diffing#1316github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Sub.fs, StackArray3, WidgetDiff.ScalarChanges, and WidgetDiff.EnvironmentChanges already have coverage from prior Repo Assist PRs. WidgetDiff.WidgetChanges (used for diffing single-widget attributes such as a Page's Content) was still untested. Added src/neutral/Fabulous.Tests/WidgetDiffWidgetChangesTests.fs covering: empty prev/next, all-Added when prev empty, all-Removed when next empty, no-op on an identical widget reference, Updated when canReuseView returns true for a changed widget, ReplacedBy when canReuseView returns false, and disjoint attribute keys (one Removed + one Added). 🤖 This is an automated change by Repo Assist, an AI assistant. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
|
I suggest holding off on reviewing/merging this PR until canary testing/QA across the repo completes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This is an automated pull request from Repo Assist, an AI assistant for this repository.
Summary
Adds unit tests for
WidgetDiff.WidgetChanges— the diffing logic used for single-widget attributes (e.g. a container'sContent), continuing the test-coverage work from prior Repo Assist PRs (#1311, #1312) that added tests forWidgetDiff.ScalarChangesandWidgetDiff.EnvironmentChanges.WidgetDiff.fsstill lacked any coverage for theWidgetChangesenumerator prior to this PR.New file:
src/neutral/Fabulous.Tests/WidgetDiffWidgetChangesTests.fsCovers:
Addedwhen prev is emptyRemovedwhen next is emptycanReuseViewreturnstrue→UpdatedcanReuseViewreturnsfalse→ReplacedByRemoved+ oneAddedSince
WidgetChangeis a struct DU whose cases carry aWidgetvalue, tests project results into a small private plain-dataWidgetChangeKindDU (same pattern used in the earlierScalarChanges/EnvironmentChangestest PRs) to keep assertions simple and independent of theWidgetstruct's#if DEBUGconditional field layout.Rationale
Part of ongoing Task 10 (Take the Repository Forward) work: incrementally closing test-coverage gaps identified in
WidgetDiff.fs.WidgetCollectionChanges/WidgetCollectionItemChanges(more involved, nested widget-list diffing) andReconciler.fsremain as follow-up candidates for a future run.Test Status
dotnet test src/neutral/Fabulous.Tests/Fabulous.Tests.fsproj -c Release: ✅ 49/49 passed (7 new tests added, was 42)dotnet fantomas --check src/neutral/Fabulous.Tests: ✅ no formatting issuesCHANGELOG.md updated under
[Unreleased].Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
avbuildtelapiv1.avaloniaui.netTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
Add this agentic workflow to your repo
To install this agentic workflow, run