-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add test for mixed flowLayout and deep tree (#7056)
Add tests for testing use of flowLayout as both true and false in same layout path. Add test for hilla view with a deep path that should get a Flow layout. Co-authored-by: Manuel Carrasco Moñino <[email protected]>
- Loading branch information
Showing
6 changed files
with
114 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
vaadin-platform-react-hybrid-test/src/main/frontend/views/flow/no-layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Button, TextField, VerticalLayout } from "@vaadin/react-components"; | ||
import type { ViewConfig } from "@vaadin/hilla-file-router/types.js"; | ||
import { useState } from "react"; | ||
import { Notification } from '@vaadin/react-components/Notification.js'; | ||
|
||
export const config: ViewConfig = { | ||
menu: { | ||
title: "Hello React NO Flow Layout", | ||
}, | ||
title: "Hilla outside Flow", | ||
flowLayout: false, | ||
}; | ||
|
||
export default function HelloHilla() { | ||
const [name, setName] = useState(""); | ||
|
||
return ( | ||
<VerticalLayout theme="padding" id={"no-flow-hilla"}> | ||
<TextField label="Your name for Hilla" onValueChanged={(e) => setName(e.detail.value)} /> | ||
<Button onClick = {() => Notification.show(`Hello ${name}` , { | ||
position: 'middle', | ||
})}> Say hello </Button> | ||
</VerticalLayout> | ||
); | ||
} |
24 changes: 24 additions & 0 deletions
24
vaadin-platform-react-hybrid-test/src/main/frontend/views/home/deep/hello.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Button, TextField, VerticalLayout } from "@vaadin/react-components"; | ||
import type { ViewConfig } from "@vaadin/hilla-file-router/types.js"; | ||
import { useState } from "react"; | ||
import { Notification } from '@vaadin/react-components/Notification.js'; | ||
|
||
export const config: ViewConfig = { | ||
menu: { | ||
title: "Non root React in Flow", | ||
}, | ||
title: "React in Flow Layout Deep Tree" | ||
}; | ||
|
||
export default function HelloHilla() { | ||
const [name, setName] = useState(""); | ||
|
||
return ( | ||
<VerticalLayout theme="padding" id={"flow-hilla-deep-tree"}> | ||
<TextField label="Your name for Hilla" onValueChanged={(e) => setName(e.detail.value)} /> | ||
<Button onClick = {() => Notification.show(`Hello ${name}` , { | ||
position: 'middle', | ||
})}> Say hello </Button> | ||
</VerticalLayout> | ||
); | ||
} |
20 changes: 20 additions & 0 deletions
20
...form-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/views/DeepLayout.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.vaadin.platform.react.test.views; | ||
|
||
import com.vaadin.flow.component.applayout.AppLayout; | ||
import com.vaadin.flow.component.applayout.DrawerToggle; | ||
import com.vaadin.flow.component.html.Footer; | ||
import com.vaadin.flow.component.html.H1; | ||
import com.vaadin.flow.component.html.Header; | ||
import com.vaadin.flow.component.html.Span; | ||
import com.vaadin.flow.component.orderedlayout.Scroller; | ||
import com.vaadin.flow.component.sidenav.SideNav; | ||
import com.vaadin.flow.component.sidenav.SideNavItem; | ||
import com.vaadin.flow.router.Layout; | ||
import com.vaadin.flow.router.RoutePrefix; | ||
import com.vaadin.flow.server.menu.MenuConfiguration; | ||
import com.vaadin.flow.theme.lumo.LumoUtility; | ||
|
||
@Layout("/home/deep") | ||
public class DeepLayout extends FlowLayout { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters