Skip to content

Commit

Permalink
CCDM: change navigate signature to accept a config object
Browse files Browse the repository at this point in the history
  • Loading branch information
manolo committed Aug 12, 2019
1 parent 1c99f08 commit bbc61c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ interface AppInitResponse {
appConfig: AppConfig;
}

export interface NavigationParameters {
path: string;
}

/**
* Client API for flow UI operations.
*/
Expand Down Expand Up @@ -53,9 +57,9 @@ export class Flow {
/**
* Go to a route defined in server.
*/
async navigate(path : string): Promise<HTMLElement> {
async navigate(params : NavigationParameters): Promise<HTMLElement> {
await this.start();
return this.getFlowElement(path);
return this.getFlowElement(params.path);
}

private async getFlowElement(routePath : string): Promise<HTMLElement> {
Expand Down
2 changes: 1 addition & 1 deletion flow-client/src/test/frontend/FlowTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ suite("Flow", () => {

mockInitResponse();
return new Flow()
.navigate("Foo/Bar.baz")
.navigate({path: "Foo/Bar.baz"})
.then(() => {
// Check that start() was called
assert.isDefined((window as any).Vaadin.Flow.resolveUri);
Expand Down

0 comments on commit bbc61c6

Please sign in to comment.