From c6f240a492bf43681df0fe8fb9bd37224b0d60e8 Mon Sep 17 00:00:00 2001 From: gmalicky <34336799+gmalicky@users.noreply.github.com> Date: Tue, 22 May 2018 17:03:42 +0200 Subject: [PATCH] Fix toMatchElement() definition --- types/expect-puppeteer/expect-puppeteer-tests.ts | 5 +++-- types/expect-puppeteer/index.d.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/types/expect-puppeteer/expect-puppeteer-tests.ts b/types/expect-puppeteer/expect-puppeteer-tests.ts index 84a7e65486..4ad0ce1f3c 100644 --- a/types/expect-puppeteer/expect-puppeteer-tests.ts +++ b/types/expect-puppeteer/expect-puppeteer-tests.ts @@ -13,8 +13,9 @@ const testGlobal = async (instance: ElementHandle | Page) => { await expect(instance).toMatch("selector"); await expect(instance).toMatch("selector", { timeout: 777 }); - await expect(instance).toMatchElement("selector", "value"); - await expect(instance).toMatchElement("selector", "value", { polling: "mutation" }); + await expect(instance).toMatchElement("selector"); + await expect(instance).toMatchElement("selector", { polling: "raf", timeout: 777 }); + await expect(instance).toMatchElement("selector", { polling: "mutation", text: "text" }); await expect(instance).toSelect("selector", "valueOrText"); await expect(instance).toSelect("selector", "valueOrText", { polling: "raf" }); diff --git a/types/expect-puppeteer/index.d.ts b/types/expect-puppeteer/index.d.ts index ce20675d37..4d599f99fe 100644 --- a/types/expect-puppeteer/index.d.ts +++ b/types/expect-puppeteer/index.d.ts @@ -42,7 +42,7 @@ interface ExpectPuppeteer { toDisplayDialog(block: () => Promise): Promise; toFill(selector: string, value: string, options?: ExpectTimingActions): Promise; toMatch(selector: string, options?: ExpectTimingActions): Promise; - toMatchElement(selector: string, value: string, options?: ExpectTimingActions): Promise; + toMatchElement(selector: string, options?: ExpectToClickOptions): Promise; toSelect(selector: string, valueOrText: string, options?: ExpectTimingActions): Promise; toUploadFile(selector: string, filePath: string, options?: ExpectTimingActions): Promise; } @@ -57,7 +57,7 @@ declare global { toDisplayDialog(block: () => Promise): Promise; toFill(selector: string, value: string, options?: ExpectTimingActions): Promise; toMatch(selector: string, options?: ExpectTimingActions): Promise; - toMatchElement(selector: string, value: string, options?: ExpectTimingActions): Promise; + toMatchElement(selector: string, options?: ExpectToClickOptions): Promise; toSelect(selector: string, valueOrText: string, options?: ExpectTimingActions): Promise; toUploadFile(selector: string, filePath: string, options?: ExpectTimingActions): Promise; }