Summary
LoginOverlayTester.notUsableReasons(Consumer<String>) has an inverted condition: it reports the "not opened" reason exactly when the overlay is opened, and reports no reason when the overlay is closed (which is precisely when the component is not usable).
Location
shared/src/main/java/com/vaadin/flow/component/login/LoginOverlayTester.java
@Override
public boolean isUsable() {
return super.isUsable() && getComponent().isOpened(); // not usable when NOT opened
}
@Override
protected void notUsableReasons(Consumer<String> collector) {
super.notUsableReasons(collector);
if (getComponent().isOpened()) { // <-- inverted
collector.accept("not opened");
}
}
Impact
isUsable() returns false when the overlay is not opened, but notUsableReasons() only adds "not opened" when it is opened. As a result, ensureComponentIsUsable() on a closed LoginOverlay throws an IllegalStateException whose reason list is missing the actual cause ("not opened"), producing a misleading "... is not usable" message with no explanation. Conversely, a reason is collected in the case where the component is usable.
Expected
The condition should be negated so the reason matches the isUsable() logic:
if (!getComponent().isOpened()) {
collector.accept("not opened");
}
🤖 Filed with Claude Code
Summary
LoginOverlayTester.notUsableReasons(Consumer<String>)has an inverted condition: it reports the "not opened" reason exactly when the overlay is opened, and reports no reason when the overlay is closed (which is precisely when the component is not usable).Location
shared/src/main/java/com/vaadin/flow/component/login/LoginOverlayTester.javaImpact
isUsable()returnsfalsewhen the overlay is not opened, butnotUsableReasons()only adds"not opened"when it is opened. As a result,ensureComponentIsUsable()on a closedLoginOverlaythrows anIllegalStateExceptionwhose reason list is missing the actual cause ("not opened"), producing a misleading "... is not usable" message with no explanation. Conversely, a reason is collected in the case where the component is usable.Expected
The condition should be negated so the reason matches the
isUsable()logic:🤖 Filed with Claude Code