Search in sources :

Example 1 with Type

use of com.vaadin.flow.shared.ui.Dependency.Type in project flow by vaadin.

the class DependencyListTest method testAddingDuplicateDependencies.

private void testAddingDuplicateDependencies(LoadMode first, LoadMode second, LoadMode expected) {
    String url = "foo/bar.js";
    Type type = Type.JAVASCRIPT;
    // need to clear so that there is no leftovers
    deps = new DependencyList();
    deps.add(new Dependency(type, url, first));
    deps.add(new Dependency(type, url, second));
    Collection<Dependency> pendingSendToClient = deps.getPendingSendToClient();
    assertEquals("Expected to have only one dependency", 1, pendingSendToClient.size());
    assertEquals("Wrong load mode resolved", pendingSendToClient.iterator().next().getLoadMode(), expected);
}
Also used : DependencyList(com.vaadin.flow.component.internal.DependencyList) Type(com.vaadin.flow.shared.ui.Dependency.Type) Dependency(com.vaadin.flow.shared.ui.Dependency)

Aggregations

DependencyList (com.vaadin.flow.component.internal.DependencyList)1 Dependency (com.vaadin.flow.shared.ui.Dependency)1 Type (com.vaadin.flow.shared.ui.Dependency.Type)1