Skip to content

Commit

Permalink
Pass eventId to script
Browse files Browse the repository at this point in the history
  • Loading branch information
georgegevoian committed Oct 10, 2023
1 parent 92e37c6 commit 685ac6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions test/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ describe('calendar', function () {
}

async function getVisibleCalendarEvent(eventId: number): Promise<any> {
return grist.executeScriptInCustomWidget(() => {
return (window as any).testGetVisibleCalendarEvent(eventId);
});
return grist.executeScriptInCustomWidget((id: number) => {
return (window as any).testGetVisibleCalendarEvent(id);
}, eventId);
}

async function getCalendarEvent(eventId: number): Promise<any> {
return grist.executeScriptInCustomWidget(() => {
return (window as any).testGetCalendarEvent(eventId);
});
return grist.executeScriptInCustomWidget((id: number) => {
return (window as any).testGetCalendarEvent(id);
}, eventId);
}

async function getCalendarViewName(): Promise<string> {
Expand Down
2 changes: 1 addition & 1 deletion test/getGrist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export class GristUtils extends GristWebDriverUtils {
return this.inCustomWidget(() => this.driver.find(selector).getText());
}

public async executeScriptInCustomWidget<T>(script: () => Promise<T>, ...args: any[]): Promise<T> {
public async executeScriptInCustomWidget<T>(script: Function, ...args: any[]): Promise<T> {
return this.inCustomWidget(() => {
return driver.executeScript(script, ...args);
})
Expand Down

0 comments on commit 685ac6f

Please sign in to comment.