Skip to content

Commit

Permalink
Flow to hilla navigation.
Browse files Browse the repository at this point in the history
  • Loading branch information
caalador committed Oct 14, 2024
1 parent 535c1c7 commit 9604ac6
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class FlowHillaView extends HorizontalLayout {
private Button sayHello;

public FlowHillaView() {
setId("flow-hilla");
setPadding(true);
setSpacing(true);
name = new TextField("Your name for Flow");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
@Route("flow")
public class FlowMainView extends VerticalLayout {
public FlowMainView() {
add(new Span("Flow root view for menu!"));
Span span = new Span("Flow root view for menu!");
span.setId("flow-main");
add(span);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.vaadin.platform.react.test;

import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.ExpectedConditions;

import com.vaadin.flow.component.sidenav.testbench.SideNavItemElement;

public class FlowInHillaIT extends AbstractPlatformTest{

@Test
public void flowViewInHillaLayout() {
Assert.assertNotNull(findElement(By.id("hilla")));

// Navigate to Flow view
$(SideNavItemElement.class).withCaption("Flow in hilla").first().click();

waitUntil(ExpectedConditions.presenceOfElementLocated(By.id("flow-hilla")));

Assert.assertNull("Showing hilla placeholder even though Flow should be shown", findElement(By.id("placeholder")));

// navigate away from Flow view
$(SideNavItemElement.class).withCaption("React Components").first().click();
}

@Override
protected String getTestPath() {
return "/hilla";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.vaadin.platform.react.test;

import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.ExpectedConditions;

import com.vaadin.flow.component.sidenav.testbench.SideNavItemElement;

public class HillaInFlowIT extends AbstractPlatformTest{

@Test
public void hillaViewInFlowLayout() {
waitUntil(ExpectedConditions.presenceOfElementLocated(By.id("flow-main")));

// Navigate to Flow view
$(SideNavItemElement.class).withCaption("Flow in hilla").first().click();

waitUntil(ExpectedConditions.presenceOfElementLocated(By.id("flow-hilla")));

Assert.assertNull("Showing hilla placeholder even though Flow should be shown", findElement(By.id("placeholder")));

// navigate away from Flow view
$(SideNavItemElement.class).withCaption("React Components").first().click();
}

@Override
protected String getTestPath() {
return "/flow";
}
}

0 comments on commit 9604ac6

Please sign in to comment.