Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default values aren't filtered when already persisted #85

Open
beatngu13 opened this issue Feb 11, 2019 · 0 comments
Open

Default values aren't filtered when already persisted #85

beatngu13 opened this issue Feb 11, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@beatngu13
Copy link
Contributor

Taken from AttributesDifferenceFinder:

private AttributeDifference differenceFor( final IdentifyingAttributes identAttributes, final Serializable expected,
		final Serializable actual, final String key ) {
	if ( expected == null ) {
		return null;
	}
	if ( RecheckIgnore.getInstance().shouldIgnoreAttribute( identAttributes, key ) ) {
		return null;
	}
	// FIXME If default is persisted, then this is true and the default isn't removed.
	if ( Objects.equals( expected, actual ) ) {
		return null;
	}
	// FIXME If default is persisted, then this should yield a AttributeDifference that removes it.
	if ( defaultValueFinder.isDefaultValue( identAttributes, key, actual ) ) {
		return null;
	}
	if ( key.equals( Attributes.SCREENSHOT ) ) {
		final Screenshot expectedScreenshot = (Screenshot) expected;
		final Screenshot actualScreenshot = (Screenshot) actual;
		final ImageDifference imgDiff = imgDiffCalc.compare( expectedScreenshot, actualScreenshot );
		if ( imgDiff.isEqual() ) {
			return null;
		} else {
			return new ScreenshotAttributeDifference( expectedScreenshot, actualScreenshot,
					imgDiff.getStrategyName(), imgDiff.getMatch() );
		}
	}
	return new AttributeDifference( key, expected, actual );
}
@beatngu13 beatngu13 added the bug Something isn't working label Feb 11, 2019
@martin-v martin-v added enhancement New feature or request and removed bug Something isn't working labels Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants