Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs(api-testing): fix broken snippet (#21499)

Max Schmitt7746807d9f13
diff --git a/docs/src/test-api-testing-js.md b/docs/src/test-api-testing-js.md
index 24c12ca120..b52c04b314 100644
--- a/docs/src/test-api-testing-js.md
+++ b/docs/src/test-api-testing-js.md
@@ -308,7 +308,7 @@ test('last created issue should be on the server', async ({ page, request }) =>
const newIssue = await request.get(`https://api.github.com/repos/${USER}/${REPO}/issues/${issueId}`);
expect(newIssue.ok()).toBeTruthy();
- expect(newIssue).toEqual(expect.objectContaining({
+ expect(newIssue.json()).toEqual(expect.objectContaining({
title: 'Bug report 1'
}));
});
@@ -353,7 +353,7 @@ test('last created issue should be on the server', async ({ page, request }) =>
const newIssue = await request.get(`https://api.github.com/repos/${USER}/${REPO}/issues/${issueId}`);
expect(newIssue.ok()).toBeTruthy();
- expect(newIssue).toEqual(expect.objectContaining({
+ expect(newIssue.json()).toEqual(expect.objectContaining({
title: 'Bug report 1'
}));
});