Open japhelps opened 2 months ago
Thanks for reporting this @japhelps. I am very busy these weeks, but will take a look as soon as possible. This may also be an issue that should be addressed over in the anglesharp-diffing repository. I would start looking there and see if this issue also exists in the diffing library. If it does, then the fix needs to be applied there.
Thanks for a very useful library and for your talks guiding how to test Blazor.
I'm also seeing this bug.
Fails:
var cut = Render( @<MudButton/> );
cut.Find("button").MarkupMatches(@<button diff:ignoreAttributes diff:ignoreChildren></button>);
Passes:
cut.Find("button").MarkupMatches(@<button diff:ignoreAttributes><span diff:ignoreAttributes></span></button>);
@nref isn't those two assertions identical?
@egil My mistake, I pasted the wrong thing. I've just now updated it. That is the code that I am using to make my test pass. But the design of the test really doesn't care that there is a span or not.
Describe the bug
Using
diff:ignoreChildren
does not ignore child elements or text of abutton
Example:
With this test:
Results in this output:
Expected behavior:
The test would succeed.
Version info:
Additional context: This should work according to the documentation here, and in general it has worked correctly.
The only way I have found to get the test to succeed is to change the button expected HTML to the following
<button diff:ignoreAttributes><span diff:ignoreChildren></span></button>