Skip to content

Commit 9be14de

Browse files
committed
Improve readability of timeout parameter
1 parent f031d8a commit 9be14de

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

test/functional/services/toasts.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class ToastsService extends FtrService {
7373

7474
public async assertToastCount(expectedCount: number) {
7575
await this.retry.tryForTime(5 * 1000, async () => {
76-
const toastCount = await this.getToastCount(1000);
76+
const toastCount = await this.getToastCount({ timeout: 1000 });
7777
expect(toastCount).to.eql(
7878
expectedCount,
7979
`Toast count should be ${expectedCount} (got ${toastCount})`
@@ -96,13 +96,13 @@ export class ToastsService extends FtrService {
9696
return await list.findAllByCssSelector(`.euiToast`);
9797
}
9898

99-
private async getGlobalToastList(timeout?: number) {
100-
return await this.testSubjects.find('globalToastList', timeout);
99+
private async getGlobalToastList(options?: { timeout?: number }) {
100+
return await this.testSubjects.find('globalToastList', options?.timeout);
101101
}
102102

103-
public async getToastCount(timeout?: number) {
104-
const list = await this.getGlobalToastList(timeout);
105-
const toasts = await list.findAllByCssSelector(`.euiToast`, timeout);
103+
public async getToastCount(options?: { timeout?: number }) {
104+
const list = await this.getGlobalToastList(options);
105+
const toasts = await list.findAllByCssSelector(`.euiToast`, options?.timeout);
106106
return toasts.length;
107107
}
108108
}

0 commit comments

Comments
 (0)