fix(browser): report mismatched event family selection as unknown in capture comparison (#2239)
* fix(browser): report mismatched event family selection as unknown in capture comparison * fix(browser): retain selected event families and unknown coverage Fold the complementary implementation from #2253 into the earlier #2239 proposal, retaining the original contribution history. Co-authored-by: itsF4LCON <107556180+itsF4LCON@users.noreply.github.com> --------- Co-authored-by: LouisChen <3361008+chqcjq@users.noreply.github.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> Co-authored-by: itsF4LCON <107556180+itsF4LCON@users.noreply.github.com>
This commit is contained in:
co-authored by
LouisChen
morluto
itsF4LCON
parent
aeee5074d1
commit
0043d9b134
@@ -5,6 +5,7 @@ import {
|
||||
artifactEvidenceState,
|
||||
captured,
|
||||
eventEvidenceState,
|
||||
eventFamilyCoverageReason,
|
||||
eventsFor,
|
||||
networkContentCoverageReason,
|
||||
screenshotProjection,
|
||||
@@ -332,7 +333,7 @@ const compareStepArtifacts = (
|
||||
),
|
||||
beforeState: eventEvidenceState(input.beforeCapture, input.beforeStep),
|
||||
afterState: eventEvidenceState(input.afterCapture, input.afterStep),
|
||||
incomparableReason: networkContentCoverageReason(
|
||||
incomparableReason: eventCoverageReason(
|
||||
input.beforeCapture,
|
||||
input.afterCapture,
|
||||
),
|
||||
@@ -340,6 +341,17 @@ const compareStepArtifacts = (
|
||||
];
|
||||
};
|
||||
|
||||
const eventCoverageReason = (
|
||||
before: BrowserScenarioCapture,
|
||||
after: BrowserScenarioCapture,
|
||||
): string | undefined => {
|
||||
const reasons = [
|
||||
eventFamilyCoverageReason(before, after),
|
||||
networkContentCoverageReason(before, after),
|
||||
].filter((reason) => reason !== undefined);
|
||||
return reasons.length === 0 ? undefined : reasons.join(" ");
|
||||
};
|
||||
|
||||
interface CompareCapturedValuesInput<Value> {
|
||||
readonly artifact: BrowserScenarioArtifactKind;
|
||||
readonly before: CaptureState<Value>;
|
||||
|
||||
Reference in New Issue
Block a user