Skip to content

Commit 07b8c23

Browse files
authored
chore: upgrade vaadin-testbench to 8.3.1 (23.6) (#8256) (#8258)
* chore: upgrade vaadin-testbench to 8.3.1 * fix: do not modify location
1 parent 957ad83 commit 07b8c23

File tree

2 files changed

+9
-9
lines changed
  • vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-testbench/src/main/java/com/vaadin/flow/component/spreadsheet/testbench

2 files changed

+9
-9
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<url>https://vaadin.com/components</url>
1414
<properties>
1515
<flow.version>23.7-SNAPSHOT</flow.version>
16-
<testbench.version>8.3.0</testbench.version>
16+
<testbench.version>8.3.1</testbench.version>
1717
<maven.compiler.source>11</maven.compiler.source>
1818
<maven.compiler.target>11</maven.compiler.target>
1919
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-testbench/src/main/java/com/vaadin/flow/component/spreadsheet/testbench/SpreadsheetElement.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,10 @@ private void scrollSheetVisible(WebElement targetSheet) {
293293
boolean isElementSelected(WebElement element) {
294294
updateSelectionLocationAndSize();
295295
Point location = element.getLocation();
296-
location.x += element.getSize().getWidth() / 2;
297-
location.y += element.getSize().getHeight() / 2;
298-
return isInSelection(location) || isNonCoherentlySelected(element);
296+
int centerX = location.x + element.getSize().getWidth() / 2;
297+
int centerY = location.y + element.getSize().getHeight() / 2;
298+
return isInSelection(centerX, centerY)
299+
|| isNonCoherentlySelected(element);
299300
}
300301

301302
private void findSelectionOutline() {
@@ -329,15 +330,14 @@ private void updateSelectionLocationAndSize() {
329330
bottomY + bottomH - sLocation.getY());
330331
}
331332

332-
private boolean isInSelection(Point location) {
333+
private boolean isInSelection(int locationX, int locationY) {
333334
// Test top left corner
334-
if (location.getX() < sLocation.getX()
335-
|| location.getY() < sLocation.getY()) {
335+
if (locationX < sLocation.getX() || locationY < sLocation.getY()) {
336336
return false;
337337
}
338338
// Test lower right corner
339-
if (location.getX() - sLocation.getX() > sSize.getWidth()
340-
|| location.getY() - sLocation.getY() > sSize.getHeight()) {
339+
if (locationX - sLocation.getX() > sSize.getWidth()
340+
|| locationY - sLocation.getY() > sSize.getHeight()) {
341341
return false;
342342
}
343343
// Everything is inside the selection

0 commit comments

Comments
 (0)