From 569c83be7ce74c7385dfab2abaaa3bbfae46a2d1 Mon Sep 17 00:00:00 2001 From: Artur Date: Thu, 14 Sep 2023 10:43:17 +0300 Subject: [PATCH 1/2] test: End to end test for auto grid (#1258) --- packages/java/tests/pom.xml | 5 + packages/java/tests/spring/pom.xml | 415 +- .../spring/react-grid-test/frontend/App.tsx | 6 + .../react-grid-test/frontend/MainLayout.tsx | 34 + .../react-grid-test/frontend/index.html | 24 + .../spring/react-grid-test/frontend/index.ts | 5 + .../react-grid-test/frontend/routes.tsx | 19 + .../frontend/views/ReadOnlyGrid.tsx | 8 + .../spring/react-grid-test/package-lock.json | 9290 +++++++++++++++++ .../tests/spring/react-grid-test/package.json | 108 + .../java/tests/spring/react-grid-test/pom.xml | 79 + .../dev/hilla/test/reactgrid/Application.java | 12 + .../java/dev/hilla/test/reactgrid/Person.java | 49 + .../test/reactgrid/PersonRepository.java | 7 + .../hilla/test/reactgrid/PersonService.java | 26 + .../hilla/test/reactgrid/package-info.java | 2 + .../src/main/resources/application.properties | 15 + .../src/main/resources/data.sql | 50 + .../hilla/test/reactgrid/ReadOnlyGridIT.java | 71 + 19 files changed, 10022 insertions(+), 203 deletions(-) create mode 100644 packages/java/tests/spring/react-grid-test/frontend/App.tsx create mode 100644 packages/java/tests/spring/react-grid-test/frontend/MainLayout.tsx create mode 100644 packages/java/tests/spring/react-grid-test/frontend/index.html create mode 100644 packages/java/tests/spring/react-grid-test/frontend/index.ts create mode 100644 packages/java/tests/spring/react-grid-test/frontend/routes.tsx create mode 100644 packages/java/tests/spring/react-grid-test/frontend/views/ReadOnlyGrid.tsx create mode 100644 packages/java/tests/spring/react-grid-test/package-lock.json create mode 100644 packages/java/tests/spring/react-grid-test/package.json create mode 100644 packages/java/tests/spring/react-grid-test/pom.xml create mode 100644 packages/java/tests/spring/react-grid-test/src/main/java/dev/hilla/test/reactgrid/Application.java create mode 100644 packages/java/tests/spring/react-grid-test/src/main/java/dev/hilla/test/reactgrid/Person.java create mode 100644 packages/java/tests/spring/react-grid-test/src/main/java/dev/hilla/test/reactgrid/PersonRepository.java create mode 100644 packages/java/tests/spring/react-grid-test/src/main/java/dev/hilla/test/reactgrid/PersonService.java create mode 100644 packages/java/tests/spring/react-grid-test/src/main/java/dev/hilla/test/reactgrid/package-info.java create mode 100644 packages/java/tests/spring/react-grid-test/src/main/resources/application.properties create mode 100644 packages/java/tests/spring/react-grid-test/src/main/resources/data.sql create mode 100644 packages/java/tests/spring/react-grid-test/src/test/java/dev/hilla/test/reactgrid/ReadOnlyGridIT.java diff --git a/packages/java/tests/pom.xml b/packages/java/tests/pom.xml index 633d9da796..82399a3c4c 100644 --- a/packages/java/tests/pom.xml +++ b/packages/java/tests/pom.xml @@ -80,6 +80,11 @@ vaadin-login-testbench ${vaadin.component.version} + + com.vaadin + vaadin-grid-testbench + ${vaadin.component.version} + com.vaadin vaadin-notification-testbench diff --git a/packages/java/tests/spring/pom.xml b/packages/java/tests/spring/pom.xml index 586843ff3e..8989e7493d 100644 --- a/packages/java/tests/spring/pom.xml +++ b/packages/java/tests/spring/pom.xml @@ -1,214 +1,223 @@ - 4.0.0 - - dev.hilla - tests - 2.3-SNAPSHOT - - - tests-spring - Hilla Spring Tests - - pom - - - true - true - ${project.parent.parent.basedir} - 9.31 - - - - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + dev.hilla + tests + 2.3-SNAPSHOT + + + tests-spring + Hilla Spring Tests + + pom + + + true + true + ${project.parent.parent.basedir} + 9.31 + + + + + + + org.springframework.boot + spring-boot-starter-web + + + + ch.qos.logback + logback-classic + + + ${spring.boot.version} + + + + com.vaadin + vaadin-testbench-bom + pom + import + ${testbench.version} + + + dev.hilla + hilla-bom + pom + import + ${project.version} + + + + com.vaadin + vaadin-lumo-theme + ${vaadin.component.version} + + + + com.nimbusds + nimbus-jose-jwt + ${nimbus-jose-jwt.version} + + + - - org.springframework.boot - spring-boot-starter-web - - - - ch.qos.logback - logback-classic - - - ${spring.boot.version} - - - - com.vaadin - vaadin-testbench-bom - pom - import - ${testbench.version} - - - - com.vaadin - vaadin-lumo-theme - ${vaadin.component.version} - - - - com.nimbusds - nimbus-jose-jwt - ${nimbus-jose-jwt.version} - + + + + org.slf4j + slf4j-simple + + + org.junit.vintage + junit-vintage-engine + test + + + + + jakarta.activation + jakarta.activation-api + ${jakarta.activation.api.version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta.annotation.api.version} + + + com.sun.xml.bind + jaxb-impl + ${jaxb.version} + - - - - - - org.slf4j - slf4j-simple - - - org.junit.vintage - junit-vintage-engine - test - - - - - jakarta.activation - jakarta.activation-api - ${jakarta.activation.api.version} - - - jakarta.annotation - jakarta.annotation-api - ${jakarta.annotation.api.version} - - - com.sun.xml.bind - jaxb-impl - ${jaxb.version} - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring.boot.version} - - - - pre-integration-test - - start - - - - post-integration-test - - stop - - - - - - - - - - maven-clean-plugin - - - - - frontend/generated - - ** - - - - - - - - org.eclipse.jetty - jetty-maven-plugin - - - - - - - it-modules - - - !skipTests - - - - endpoints - endpoints-contextpath - endpoints discovery - endpoints-custom-client - + + pre-integration-test + + start + + + + post-integration-test + + stop + + + + + + + + + + maven-clean-plugin + + + + + frontend/generated + + ** + + + + + + + + org.eclipse.jetty + jetty-maven-plugin + + + + + + + it-modules + + + !skipTests + + + + endpoints + endpoints-contextpath + endpoints discovery + endpoints-custom-client + - endpoints-latest-java - - security - security-contextpath - security-jwt - security-urlmapping - - - - - it-modules-group-1 - - endpoints - endpoints discovery - endpoints-custom-client - - endpoints-latest-java - - - - - it-modules-group-2 - - security - security-contextpath - security-jwt - security-urlmapping - - - - - it-modules-some - - endpoints - endpoints discovery - security - - - - - native - - native - - - - - validation - - true - - - + endpoints-latest-java + react-grid-test + + + + + it-modules-group-2 + + security + security-contextpath + security-jwt + security-urlmapping + + + + + it-modules-some + + endpoints + endpoints discovery + security + + + + + native + + native + + + + + validation + + true + + + diff --git a/packages/java/tests/spring/react-grid-test/frontend/App.tsx b/packages/java/tests/spring/react-grid-test/frontend/App.tsx new file mode 100644 index 0000000000..6b7546d1ed --- /dev/null +++ b/packages/java/tests/spring/react-grid-test/frontend/App.tsx @@ -0,0 +1,6 @@ +import router from 'Frontend/routes.js'; +import { RouterProvider } from 'react-router-dom'; + +export default function App() { + return ; +} diff --git a/packages/java/tests/spring/react-grid-test/frontend/MainLayout.tsx b/packages/java/tests/spring/react-grid-test/frontend/MainLayout.tsx new file mode 100644 index 0000000000..fda76cb530 --- /dev/null +++ b/packages/java/tests/spring/react-grid-test/frontend/MainLayout.tsx @@ -0,0 +1,34 @@ +import { AppLayout } from '@hilla/react-components/AppLayout.js'; +import { DrawerToggle } from '@hilla/react-components/DrawerToggle.js'; +import { Scroller } from '@hilla/react-components/Scroller.js'; +import { routes } from 'Frontend/routes.js'; +import { NavLink, Outlet } from 'react-router-dom'; + +export default function MainLayout() { + const menuRoutes = routes[0]!.children; + + return ( + +
+

My App

+
+ + + +